X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=62b1193907e3dd7e93fe78ed0884c0f860ed4311;hp=5f9c29e4a389745c38639e984b11b8df61cc4126;hb=12e79be91039796299187ba1b2f1559552642ea4;hpb=759b3c79cf94d101163f646b1eb2a9f9c64293ab diff --git a/src/tt.h b/src/tt.h index 5f9c29e4..62b11939 100644 --- a/src/tt.h +++ b/src/tt.h @@ -41,28 +41,7 @@ struct TTEntry { Value eval() const { return (Value)eval16; } Depth depth() const { return (Depth)(depth8 * int(ONE_PLY)); } Bound bound() const { return (Bound)(genBound8 & 0x3); } - - void save(Key k, Value v, Bound b, Depth d, Move m, Value ev, uint8_t g) { - - assert(d / ONE_PLY * ONE_PLY == d); - - // Preserve any existing move for the same position - if (m || (k >> 48) != key16) - move16 = (uint16_t)m; - - // Don't overwrite more valuable entries - if ( (k >> 48) != key16 - || d / ONE_PLY > depth8 - 4 - /* || g != (genBound8 & 0xFC) // Matching non-zero keys are already refreshed by probe() */ - || b == BOUND_EXACT) - { - key16 = (uint16_t)(k >> 48); - value16 = (int16_t)v; - eval16 = (int16_t)ev; - genBound8 = (uint8_t)(g | b); - depth8 = (int8_t)(d / ONE_PLY); - } - } + void save(Key k, Value v, Bound b, Depth d, Move m, Value ev); private: friend class TranspositionTable; @@ -98,7 +77,6 @@ class TranspositionTable { public: ~TranspositionTable() { free(mem); } void new_search() { generation8 += 4; } // Lower 2 bits are used by Bound - uint8_t generation() const { return generation8; } TTEntry* probe(const Key key, bool& found) const; int hashfull() const; void resize(size_t mbSize); @@ -110,6 +88,8 @@ public: } private: + friend struct TTEntry; + size_t clusterCount; Cluster* table; void* mem;