X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=ae530c2a0244e2d69b56bf3115536e4c9ed31e97;hp=39c161df1660575a8017e3e368337476b040c3e8;hb=a56322fde813094afd8ffa60d12761f94e0bd3ef;hpb=b76c04c0975326d3274d7d7fb6df4edef7a040b5 diff --git a/src/tt.h b/src/tt.h index 39c161df..ae530c2a 100644 --- a/src/tt.h +++ b/src/tt.h @@ -139,24 +139,21 @@ 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. +/// Without cluster concept, overwrite policy nor resizing. template struct SimpleHash { typedef SimpleHash Base; - void init() { - - if (entries) - return; + SimpleHash() { 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)); }