X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftt.h;h=1e344c3f06ef43f2b19af60f716d9a7c9990e0b8;hb=304deb5e833baf47c147e93377f5c7ef582ab822;hp=2cc1a3c5d3bfa8a394045e9df9db5d6b854b0bff;hpb=553655eb073cdd59c726dd77fcf368d499029467;p=stockfish diff --git a/src/tt.h b/src/tt.h index 2cc1a3c5..1e344c3f 100644 --- a/src/tt.h +++ b/src/tt.h @@ -137,33 +137,33 @@ inline void TranspositionTable::refresh(const TTEntry* tte) const { } -/// A simple fixed size hash table used to store pawns and material -/// configurations. It is basically just an array of Entry objects. -/// Without cluster concept or overwrite policy. +/// A simple hash table used to store pawns and material configurations. It is +/// basically just an array of Entry objects. Without cluster concept, overwrite +/// policy nor resizing. template -struct SimpleHash { +struct HashTable { - typedef SimpleHash Base; + typedef HashTable Base; - SimpleHash() { + HashTable() { entries = new (std::nothrow) Entry[HashSize]; if (!entries) { std::cerr << "Failed to allocate " << HashSize * sizeof(Entry) << " bytes for hash table." << std::endl; - exit(EXIT_FAILURE); + ::exit(EXIT_FAILURE); } memset(entries, 0, HashSize * sizeof(Entry)); } - virtual ~SimpleHash() { delete [] entries; } + virtual ~HashTable() { delete [] entries; } Entry* probe(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); } void prefetch(Key key) const { ::prefetch((char*)probe(key)); } -protected: +private: Entry* entries; };