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:
Marco Costalba
2009-06-02 09:35:49 +01:00
parent 5b1316f7bb
commit e1ed67aacb
5 changed files with 16 additions and 21 deletions

View File

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