Array castleRightsMask[] is not static because it can
be different for different positions, so let it be
a Position member data. This allows to remove tricky
hacks to take in account that although it was defined
static it could change.
Theoretically now copying a position is a bit slower because
we need to copy also an array of 64 integers, but because in
split() we don't copy the position anymore, but just keep the
pointer, the added burden is not mesurable even in MP case.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
-int Position::castleRightsMask[64];
-
Key Position::zobrist[2][8][64];
Key Position::zobEp[64];
Key Position::zobCastle[16];
Key Position::zobrist[2][8][64];
Key Position::zobEp[64];
Key Position::zobCastle[16];
Color sideToMove;
int gamePly;
Key history[MaxGameLength];
Color sideToMove;
int gamePly;
Key history[MaxGameLength];
+ int castleRightsMask[64];
File initialKFile, initialKRFile, initialQRFile;
StateInfo startState;
StateInfo* st;
// Static variables
File initialKFile, initialKRFile, initialQRFile;
StateInfo startState;
StateInfo* st;
// Static variables
- static int castleRightsMask[64];
static Key zobrist[2][8][64];
static Key zobEp[64];
static Key zobCastle[16];
static Key zobrist[2][8][64];
static Key zobEp[64];
static Key zobCastle[16];
{
TM.set_active_threads(newActiveThreads);
init_eval(TM.active_threads());
{
TM.set_active_threads(newActiveThreads);
init_eval(TM.active_threads());
- // HACK: init_eval() destroys the static castleRightsMask[] array in the
- // Position class. The below line repairs the damage.
- Position p(pos.to_fen());
- assert(pos.is_ok());
}
// Wake up sleeping threads
}
// Wake up sleeping threads