mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Fix a possible overflow in TT resize
On platforms where size_t is 32 bit, we can have an overflow in this expression: (mbSize * 1024 * 1024) Fix it setting max hash size of 2GB on platforms where size_t is 32 bit. A small rename while there: now struct Cluster is definied inside class TranspositionTable so we should drop the redundant TT prefix. No functional change.
This commit is contained in:
@@ -54,11 +54,13 @@ bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const
|
||||
|
||||
void init(OptionsMap& o) {
|
||||
|
||||
const int MaxHashMB = Is64Bit ? 1024 * 1024 : 2048;
|
||||
|
||||
o["Write Debug Log"] << Option(false, on_logger);
|
||||
o["Contempt"] << Option(0, -100, 100);
|
||||
o["Min Split Depth"] << Option(0, 0, 12, on_threads);
|
||||
o["Threads"] << Option(1, 1, MAX_THREADS, on_threads);
|
||||
o["Hash"] << Option(16, 1, 1024 * 1024, on_hash_size);
|
||||
o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size);
|
||||
o["Clear Hash"] << Option(on_clear_hash);
|
||||
o["Ponder"] << Option(true);
|
||||
o["MultiPV"] << Option(1, 1, 500);
|
||||
|
||||
Reference in New Issue
Block a user