X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=3edd5e8a1fdfda660eedc08ea89c57261eeb364b;hp=39c161df1660575a8017e3e368337476b040c3e8;hb=55df3fa2d7631ed67e46f9433aa7f3a71c18e5e7;hpb=b76c04c0975326d3274d7d7fb6df4edef7a040b5 diff --git a/src/tt.h b/src/tt.h index 39c161df..3edd5e8a 100644 --- a/src/tt.h +++ b/src/tt.h @@ -20,12 +20,9 @@ #if !defined(TT_H_INCLUDED) #define TT_H_INCLUDED -#include - #include "misc.h" #include "types.h" - /// The TTEntry is the class of transposition table entries /// /// A TTEntry needs 128 bits to be stored @@ -136,38 +133,4 @@ inline void TranspositionTable::refresh(const TTEntry* tte) const { const_cast(tte)->set_generation(generation); } - -/// 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. - -template -struct SimpleHash { - - typedef SimpleHash Base; - - void init() { - - if (entries) - return; - - 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); - } - memset(entries, 0, HashSize * sizeof(Entry)); - } - - virtual ~SimpleHash() { delete [] entries; } - - Entry* probe(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); } - void prefetch(Key key) const { ::prefetch((char*)probe(key)); } - -protected: - Entry* entries; -}; - #endif // !defined(TT_H_INCLUDED)