maybe fixed crashes | bench 1801941

This commit is contained in:
rektdie committed 2026-02-24 23:34:26 +01:00
1 parent eac21b424a
commit 64b2e3d9b1
5 files changed
+60 -28

No files matched your search

+6 -5
View File
@@ -68,11 +68,11 @@ public:
table.resize(size);
}
void PrefetchEntry(U64 &hashKey) {
void PrefetchEntry(const U64 &hashKey) {
__builtin_prefetch(&table[hashKey % table.size()]);
}
TTEntry GetEntry(U64 &hashKey) {
TTEntry GetEntry(const U64 &hashKey) {
TTBucket *current = &table[hashKey % table.size()];
if (current->depthPreferred.hashKey == hashKey) {
return current->depthPreferred;
@@ -86,15 +86,16 @@ public:
// returns used space per mill
int GetUsedPercentage() {
int count = 0;
const U64 sampleSize = std::min<U64>(1000, table.size());
for (int i = 0; i < 1000; i++) {
for (U64 i = 0; i < sampleSize; i++) {
if (table[i].depthPreferred || table[i].alwaysReplace) count++;
}
return count;
}
void WriteEntry(U64 &hashKey, int depth, int score, int nodeType, Move bestMove, bool ttpv);
void WriteEntry(const U64 &hashKey, int depth, int score, int nodeType, Move bestMove, bool ttpv);
};
extern TTable SharedTT;
extern TTable SharedTT;