]> git.sesse.net Git - stockfish/commitdiff
Raise max Hash to 1TB
authorlucasart <lucas.braesch@gmail.com>
Tue, 1 Jul 2014 10:13:20 +0000 (18:13 +0800)
committerlucasart <lucas.braesch@gmail.com>
Tue, 1 Jul 2014 10:37:18 +0000 (18:37 +0800)
And use size_t where appropriate, as suggested on FishCooking.

No functional change.

src/tt.cpp
src/tt.h
src/ucioption.cpp

index 248cbad96d930baebe75d7bae3536145a69ccd1a..46d891cd04f1558e76b0f2b9161d872c1928694a 100644 (file)
@@ -30,11 +30,9 @@ TranspositionTable TT; // Our global transposition table
 /// measured in megabytes. Transposition table consists of a power of 2 number
 /// of clusters and each cluster consists of TTClusterSize number of TTEntry.
 
 /// measured in megabytes. Transposition table consists of a power of 2 number
 /// of clusters and each cluster consists of TTClusterSize number of TTEntry.
 
-void TranspositionTable::resize(uint64_t mbSize) {
+void TranspositionTable::resize(size_t mbSize) {
 
 
-  assert(msb((mbSize * 1024 * 1024) / sizeof(TTCluster)) < 32);
-
-  uint32_t newClusterCount = 1 << msb((mbSize * 1024 * 1024) / sizeof(TTCluster));
+  size_t newClusterCount = size_t(1) << msb((mbSize * 1024 * 1024) / sizeof(TTCluster));
 
   if (newClusterCount == clusterCount)
       return;
 
   if (newClusterCount == clusterCount)
       return;
index e9c25ad2d7da732b7ad7c071878887bb197c9824..c442205253e2232aad77ffde7bf9ea70bc6bc0ba 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -89,12 +89,12 @@ public:
 
   const TTEntry* probe(const Key key) const;
   TTEntry* first_entry(const Key key) const;
 
   const TTEntry* probe(const Key key) const;
   TTEntry* first_entry(const Key key) const;
-  void resize(uint64_t mbSize);
+  void resize(size_t mbSize);
   void clear();
   void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV);
 
 private:
   void clear();
   void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV);
 
 private:
-  uint32_t clusterCount;
+  size_t clusterCount;
   TTCluster* table;
   void* mem;
   uint8_t generation; // Size must be not bigger than TTEntry::genBound8
   TTCluster* table;
   void* mem;
   uint8_t generation; // Size must be not bigger than TTEntry::genBound8
index ed46d71e6f43f016ad58d7df597e4b4f3722fba7..5833ef7b067d8bbcf513f1c4f3726f3f0511e40f 100644 (file)
@@ -60,7 +60,7 @@ void init(OptionsMap& o) {
   o["Contempt Factor"]          << Option(0, -50,  50);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);
   o["Contempt Factor"]          << Option(0, -50,  50);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);
-  o["Hash"]                     << Option(32, 1, 16384, on_hash_size);
+  o["Hash"]                     << Option(32, 1, 1024 * 1024, on_hash_size);
   o["Clear Hash"]               << Option(on_clear_hash);
   o["Ponder"]                   << Option(true);
   o["MultiPV"]                  << Option(1, 1, 500);
   o["Clear Hash"]               << Option(on_clear_hash);
   o["Ponder"]                   << Option(true);
   o["MultiPV"]                  << Option(1, 1, 500);