]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Move pawn and material tables under Thread class
[stockfish] / src / position.cpp
index e3bf4aee3e17863c55ca862ff15607443d395512..2172180cfb694783feddebd048e7546133475f98 100644 (file)
@@ -29,6 +29,7 @@
 #include "position.h"
 #include "psqtab.h"
 #include "rkiss.h"
+#include "thread.h"
 #include "tt.h"
 #include "ucioption.h"
 
@@ -649,7 +650,7 @@ bool Position::pl_move_is_evasion(Move m, Bitboard pinned) const
 
 bool Position::move_is_legal(const Move m) const {
 
-  MoveStack mlist[MOVES_MAX];
+  MoveStack mlist[MAX_MOVES];
   MoveStack *cur, *last = generate<MV_PSEUDO_LEGAL>(*this, mlist);
 
    for (cur = mlist; cur != last; cur++)
@@ -1047,7 +1048,8 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   }
 
   // Prefetch pawn and material hash tables
-  prefetchTables(st->pawnKey, st->materialKey, threadID);
+  ThreadsMgr[threadID].pawnTable.prefetch(st->pawnKey);
+  ThreadsMgr[threadID].materialTable.prefetch(st->materialKey);
 
   // Update incremental scores
   st->value += pst_delta(piece, from, to);
@@ -1795,7 +1797,7 @@ bool Position::is_draw() const {
 
 bool Position::is_mate() const {
 
-  MoveStack moves[MOVES_MAX];
+  MoveStack moves[MAX_MOVES];
   return is_check() && generate<MV_LEGAL>(*this, moves) == moves;
 }