mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Increase TT size limit to 8 GB
We had an overflow due to use an integer for hash size, now we use a size_t as we should, so we can increase to an higher limit. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
8008f78415
commit
4b55d3d883
3 changed files with 5 additions and 7 deletions
|
@ -53,11 +53,9 @@ TranspositionTable::~TranspositionTable() {
|
||||||
/// TranspositionTable::set_size sets the size of the transposition table,
|
/// TranspositionTable::set_size sets the size of the transposition table,
|
||||||
/// measured in megabytes.
|
/// measured in megabytes.
|
||||||
|
|
||||||
void TranspositionTable::set_size(unsigned mbSize) {
|
void TranspositionTable::set_size(size_t mbSize) {
|
||||||
|
|
||||||
assert(mbSize >= 4 && mbSize <= 2048);
|
size_t newSize = 1024;
|
||||||
|
|
||||||
unsigned newSize = 1024;
|
|
||||||
|
|
||||||
// We store a cluster of ClusterSize number of TTEntry for each position
|
// We store a cluster of ClusterSize number of TTEntry for each position
|
||||||
// and newSize is the maximum number of storable positions.
|
// and newSize is the maximum number of storable positions.
|
||||||
|
|
4
src/tt.h
4
src/tt.h
|
@ -95,7 +95,7 @@ class TranspositionTable {
|
||||||
public:
|
public:
|
||||||
TranspositionTable();
|
TranspositionTable();
|
||||||
~TranspositionTable();
|
~TranspositionTable();
|
||||||
void set_size(unsigned mbSize);
|
void set_size(size_t mbSize);
|
||||||
void clear();
|
void clear();
|
||||||
void store(const Key posKey, Value v, ValueType type, Depth d, Move m);
|
void store(const Key posKey, Value v, ValueType type, Depth d, Move m);
|
||||||
TTEntry* retrieve(const Key posKey) const;
|
TTEntry* retrieve(const Key posKey) const;
|
||||||
|
@ -114,7 +114,7 @@ private:
|
||||||
unsigned writes; // heavy SMP read/write access here
|
unsigned writes; // heavy SMP read/write access here
|
||||||
unsigned char pad_after[64];
|
unsigned char pad_after[64];
|
||||||
|
|
||||||
unsigned size;
|
size_t size;
|
||||||
TTCluster* entries;
|
TTCluster* entries;
|
||||||
uint8_t generation;
|
uint8_t generation;
|
||||||
};
|
};
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace {
|
||||||
o["Minimum Split Depth"] = Option(4, 4, 7);
|
o["Minimum Split Depth"] = Option(4, 4, 7);
|
||||||
o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
|
o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
|
||||||
o["Threads"] = Option(1, 1, THREAD_MAX);
|
o["Threads"] = Option(1, 1, THREAD_MAX);
|
||||||
o["Hash"] = Option(32, 4, 2048);
|
o["Hash"] = Option(32, 4, 8192);
|
||||||
o["Clear Hash"] = Option(false, BUTTON);
|
o["Clear Hash"] = Option(false, BUTTON);
|
||||||
o["New Game"] = Option(false, BUTTON);
|
o["New Game"] = Option(false, BUTTON);
|
||||||
o["Ponder"] = Option(true);
|
o["Ponder"] = Option(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue