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:
Marco Costalba
2013-09-26 19:25:50 +02:00
parent 7b2cda95d9
commit 800410eef1
4 changed files with 14 additions and 6 deletions

View File

@@ -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;