mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Use a per-thread array for generated moves
This greately reduces stack usage and is a prerequisite for next patch. Verified with 40K games both in single and SMP case that there are no regressions. No functional change.
This commit is contained in:
@@ -115,6 +115,8 @@ struct Thread : public ThreadBase {
|
||||
virtual void idle_loop();
|
||||
bool cutoff_occurred() 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, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove,
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user