mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +00:00
Avoid using EmptySearchStack global
This reduces contention in SMP case and also cleanups the code a bit. No functional change Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+10
-5
@@ -63,13 +63,18 @@ namespace {
|
||||
/// search captures, promotions and some checks) and about how important good
|
||||
/// move ordering is at the current node.
|
||||
|
||||
MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
|
||||
const SearchStack& ss, Depth d) : pos(p) {
|
||||
MovePicker::MovePicker(const Position& p, bool pv, Move ttm, Depth d, SearchStack* ss) : pos(p) {
|
||||
|
||||
pvNode = pv;
|
||||
ttMove = ttm;
|
||||
mateKiller = (ss.mateKiller == ttm)? MOVE_NONE : ss.mateKiller;
|
||||
killer1 = ss.killers[0];
|
||||
killer2 = ss.killers[1];
|
||||
if (ss)
|
||||
{
|
||||
mateKiller = (ss->mateKiller == ttm)? MOVE_NONE : ss->mateKiller;
|
||||
killer1 = ss->killers[0];
|
||||
killer2 = ss->killers[1];
|
||||
} else
|
||||
mateKiller = killer1 = killer2 = MOVE_NONE;
|
||||
|
||||
depth = d;
|
||||
movesPicked = 0;
|
||||
numOfMoves = 0;
|
||||
|
||||
Reference in New Issue
Block a user