X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftt.h;h=fb414bf157aeba9fa98fbe70bbb728cd27445e1e;hb=2a461b4b745b2542f6e13bab8c60abdb366bc128;hp=0918e3e8d3938ff7a3aac7b4859c8f572c910d91;hpb=2f2e48fad23225d23f87b95fb842156cfee668fb;p=stockfish diff --git a/src/tt.h b/src/tt.h index 0918e3e8..fb414bf1 100644 --- a/src/tt.h +++ b/src/tt.h @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008 Marco Costalba + Copyright (C) 2008-2009 Marco Costalba Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -83,16 +83,22 @@ public: ~TranspositionTable(); void set_size(unsigned mbSize); void clear(); - void store(const Position& pos, Value v, ValueType type, Depth d, Move m); - TTEntry* retrieve(const Position& pos) const; + void store(const Key posKey, Value v, ValueType type, Depth d, Move m); + TTEntry* retrieve(const Key posKey) const; void new_search(); void insert_pv(const Position& pos, Move pv[]); int full() const; private: - inline TTEntry* first_entry(const Position& pos) const; + inline TTEntry* first_entry(const Key posKey) const; - unsigned size, writes; + // Be sure 'writes' is at least one cacheline away + // from read only variables. + unsigned char pad_before[64 - sizeof(unsigned)]; + unsigned writes; // heavy SMP read/write access here + unsigned char pad_after[64]; + + unsigned size; TTEntry* entries; uint8_t generation; };