X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=5c3ddc5269de6e302f2b50566705c13a1f01b79f;hp=94ee78e70f233f9126bee035e1213403551bee8f;hb=e8f885145bd487690a8959928c0573f2edfa5785;hpb=06c14d0a37c370c1102494aea6a69b5fe4f5250f diff --git a/src/tt.h b/src/tt.h index 94ee78e7..5c3ddc52 100644 --- a/src/tt.h +++ b/src/tt.h @@ -46,7 +46,7 @@ class SimpleHash { public: SimpleHash() { - entries = new Entry[HashSize]; + entries = new (std::nothrow) Entry[HashSize]; if (!entries) { std::cerr << "Failed to allocate " << HashSize * sizeof(Entry) @@ -56,7 +56,7 @@ public: memset(entries, 0, HashSize * sizeof(Entry)); } - ~SimpleHash() { delete [] entries; } + virtual ~SimpleHash() { delete [] entries; } Entry* find(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); }