]> git.sesse.net Git - stockfish/commitdiff
Use THREAD_MAX instead of hardcoded 8
authorMarco Costalba <mcostalba@gmail.com>
Sun, 27 Dec 2009 12:52:29 +0000 (13:52 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 27 Dec 2009 12:52:29 +0000 (13:52 +0100)
This will allow to change THREAD_MAX value in the future.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp
src/ucioption.cpp

index 71f6cf79afaa594af2e6245285816e7b44898d37..b50a023b557c3aad61691721c638c1df7b6ee68a 100644 (file)
@@ -251,9 +251,10 @@ namespace {
   // in init_safety().
   Value SafetyTable[100];
 
-  // Pawn and material hash tables, indexed by the current thread id
-  MaterialInfoTable* MaterialTable[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-  PawnInfoTable* PawnTable[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+  // Pawn and material hash tables, indexed by the current thread id.
+  // Note that they will be initialized at 0 being global variables.
+  MaterialInfoTable* MaterialTable[THREAD_MAX];
+  PawnInfoTable* PawnTable[THREAD_MAX];
 
   // Sizes of pawn and material hash tables
   const int PawnTableSize = 16384;
index c99644f2c37641f82d590d67084eb89319446155..0f9c2f8a263b1d751adb284d82e02d1d81e24435 100644 (file)
@@ -122,7 +122,7 @@ namespace {
     o["Randomness"] = Option(0, 0, 10);
     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, 8);
+    o["Threads"] = Option(1, 1, THREAD_MAX);
     o["Hash"] = Option(32, 4, 2048);
     o["Clear Hash"] = Option(false, BUTTON);
     o["New Game"] = Option(false, BUTTON);