]> git.sesse.net Git - stockfish/blobdiff - src/thread.h
Simplify extensions
[stockfish] / src / thread.h
index 7557c0e7a90a80695dc37ae10aae4d2d8b08867a..645482673ba1b93fbc1dfe9449b329aee0abf049 100644 (file)
@@ -114,10 +114,12 @@ struct Thread : public ThreadBase {
   Thread();
   virtual void idle_loop();
   bool cutoff_occurred() const;
-  bool is_available_to(Thread* master) const;
+  bool is_available_to(const Thread* master) const;
+  ExtMove* get_moves_array() { return &movePages[curPage += MAX_MOVES]; }
+  void free_moves_array() { curPage -= MAX_MOVES; }
 
   template <bool Fake>
-  void split(Position& pos, Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove,
+  void split(Position& pos, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove,
              Depth depth, Move threatMove, int moveCount, MovePicker* movePicker, int nodeType, bool cutNode);
 
   SplitPoint splitPoints[MAX_SPLITPOINTS_PER_THREAD];
@@ -125,6 +127,8 @@ struct Thread : public ThreadBase {
   Endgames endgames;
   Pawns::Table pawnsTable;
   Position* activePosition;
+  std::vector<ExtMove> movePages;
+  int curPage;
   size_t idx;
   int maxPly;
   SplitPoint* volatile activeSplitPoint;
@@ -160,7 +164,7 @@ struct ThreadPool : public std::vector<Thread*> {
 
   MainThread* main() { return static_cast<MainThread*>((*this)[0]); }
   void read_uci_options();
-  Thread* available_slave(Thread* master) const;
+  Thread* available_slave(const Thread* master) const;
   void wait_for_think_finished();
   void start_thinking(const Position&, const Search::LimitsType&,
                       const std::vector<Move>&, Search::StateStackPtr&);