X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftt.cpp;h=7e95a2a4e6dbcd74f374dd534b1b611fd2787a62;hb=6596f0eac0c1d25a12bfd923907bfc78beedbc90;hp=080d3a6bd480006e4c821661d2ec9800a4b7523b;hpb=39437f4e55aaa26ef9f0d5a1c762e560e9ffde32;p=stockfish diff --git a/src/tt.cpp b/src/tt.cpp index 080d3a6b..7e95a2a4 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -66,7 +66,7 @@ void TranspositionTable::resize(size_t mbSize) { free(mem); clusterCount = mbSize * 1024 * 1024 / sizeof(Cluster); - table = static_cast(aligned_ttmem_alloc(clusterCount * sizeof(Cluster), &mem)); + table = static_cast(aligned_ttmem_alloc(clusterCount * sizeof(Cluster), mem)); if (!mem) { std::cerr << "Failed to allocate " << mbSize @@ -148,9 +148,9 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const { int TranspositionTable::hashfull() const { int cnt = 0; - for (int i = 0; i < 1000 / ClusterSize; ++i) + for (int i = 0; i < 1000; ++i) for (int j = 0; j < ClusterSize; ++j) cnt += (table[i].entry[j].genBound8 & 0xF8) == generation8; - return cnt * 1000 / (ClusterSize * (1000 / ClusterSize)); + return cnt / ClusterSize; }