]> git.sesse.net Git - stockfish/commitdiff
Increase TT size limit to 8 GB
authorMarco Costalba <mcostalba@gmail.com>
Mon, 1 Feb 2010 15:53:10 +0000 (16:53 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 1 Feb 2010 15:53:10 +0000 (16:53 +0100)
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>
src/tt.cpp
src/tt.h
src/ucioption.cpp

index 1b2ae720dbe60a43826e82f457ff5254a1c0fb35..010bdc954e60b0b0a438fdf2bdc417b3a65c0cef 100644 (file)
@@ -53,11 +53,9 @@ TranspositionTable::~TranspositionTable() {
 /// TranspositionTable::set_size sets the size of the transposition table,
 /// measured in megabytes.
 
 /// TranspositionTable::set_size sets the size of the transposition table,
 /// measured in megabytes.
 
-void TranspositionTable::set_size(unsigned mbSize) {
+void TranspositionTable::set_size(size_t mbSize) {
 
 
-  assert(mbSize >= 4 && mbSize <= 2048);
-
-  unsigned newSize = 1024;
+  size_t newSize = 1024;
 
   // We store a cluster of ClusterSize number of TTEntry for each position
   // and newSize is the maximum number of storable positions.
 
   // We store a cluster of ClusterSize number of TTEntry for each position
   // and newSize is the maximum number of storable positions.
index 5d0df726239cabb66cb13628ac3523e9fb676c9c..2b2ce606eff1bd8615f7834101d70f7c8c550641 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -95,7 +95,7 @@ class TranspositionTable {
 public:
   TranspositionTable();
   ~TranspositionTable();
 public:
   TranspositionTable();
   ~TranspositionTable();
-  void set_size(unsigned mbSize);
+  void set_size(size_t mbSize);
   void clear();
   void store(const Key posKey, Value v, ValueType type, Depth d, Move m);
   TTEntry* retrieve(const Key posKey) const;
   void clear();
   void store(const Key posKey, Value v, ValueType type, Depth d, Move m);
   TTEntry* retrieve(const Key posKey) const;
@@ -114,7 +114,7 @@ private:
   unsigned writes; // heavy SMP read/write access here
   unsigned char pad_after[64];
 
   unsigned writes; // heavy SMP read/write access here
   unsigned char pad_after[64];
 
-  unsigned size;
+  size_t size;
   TTCluster* entries;
   uint8_t generation;
 };
   TTCluster* entries;
   uint8_t generation;
 };
index fe98457546ec1e39df58a38b066d77992d97b04a..e118d45be5614e9a86306915ea5ec91290b50f51 100644 (file)
@@ -121,7 +121,7 @@ namespace {
     o["Minimum Split Depth"] = Option(4, 4, 7);
     o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
     o["Threads"] = Option(1, 1, THREAD_MAX);
     o["Minimum Split Depth"] = Option(4, 4, 7);
     o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
     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["New Game"] = Option(false, BUTTON);
     o["Ponder"] = Option(true);
     o["Clear Hash"] = Option(false, BUTTON);
     o["New Game"] = Option(false, BUTTON);
     o["Ponder"] = Option(true);