Skip to content

Commit

Permalink
Test if moves is needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpldgr committed Nov 10, 2024
1 parent 7251028 commit b9198b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/movepick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
: pos(p), mainHistory(mh), gateHistory(dh), lowPlyHistory(lp), captureHistory(cph), continuationHistory(ch),
ttMove(ttm), refutations{{killers[0], 0}, {killers[1], 0}, {cm, 0}}, depth(d), ply(pl) {

/*
#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
this->moves = (ExtMove*)malloc(moveListSize);
if (this->moves == 0)
Expand All @@ -76,6 +77,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
exit(1);
}
#endif
*/

assert(d > 0);

Expand All @@ -88,6 +90,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
const CapturePieceToHistory* cph, const PieceToHistory** ch, Square rs)
: pos(p), mainHistory(mh), gateHistory(dh), captureHistory(cph), continuationHistory(ch), ttMove(ttm), recaptureSquare(rs), depth(d) {

/*
#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
this->moves = (ExtMove*)malloc(moveListSize);
if (this->moves == 0)
Expand All @@ -96,6 +99,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
exit(1);
}
#endif
*/

assert(d <= 0);

Expand All @@ -110,6 +114,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
MovePicker::MovePicker(const Position& p, Move ttm, Value th, const GateHistory* dh, const CapturePieceToHistory* cph)
: pos(p), gateHistory(dh), captureHistory(cph), ttMove(ttm), threshold(th) {

/*
#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
this->moves = (ExtMove*)malloc(moveListSize);
if (this->moves == 0)
Expand All @@ -118,6 +123,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Value th, const GateHistory*
exit(1);
}
#endif
*/

assert(!pos.checkers());

Expand Down
2 changes: 2 additions & 0 deletions src/movepick.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,13 @@ class MovePicker {
Depth depth;
int ply;

/*
#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
ExtMove* moves = 0;
#else
ExtMove moves[MAX_MOVES];
#endif
*/
};

} // namespace Stockfish
Expand Down

0 comments on commit b9198b7

Please sign in to comment.