mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Use fast_copy() instead of full copy in sp_search
And detach splitPoint Position from the master one. So we duplicate StateInfo only once in split() instead of one for each thread in sp_search No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -1813,7 +1813,8 @@ namespace {
|
|||||||
assert(threadID >= 0 && threadID < ActiveThreads);
|
assert(threadID >= 0 && threadID < ActiveThreads);
|
||||||
assert(ActiveThreads > 1);
|
assert(ActiveThreads > 1);
|
||||||
|
|
||||||
Position pos = Position(sp->pos);
|
Position pos;
|
||||||
|
pos.fast_copy(sp->pos);
|
||||||
CheckInfo ci(pos);
|
CheckInfo ci(pos);
|
||||||
SearchStack* ss = sp->sstack[threadID];
|
SearchStack* ss = sp->sstack[threadID];
|
||||||
Value value = -VALUE_INFINITE;
|
Value value = -VALUE_INFINITE;
|
||||||
@@ -1955,7 +1956,8 @@ namespace {
|
|||||||
assert(threadID >= 0 && threadID < ActiveThreads);
|
assert(threadID >= 0 && threadID < ActiveThreads);
|
||||||
assert(ActiveThreads > 1);
|
assert(ActiveThreads > 1);
|
||||||
|
|
||||||
Position pos = Position(sp->pos);
|
Position pos;
|
||||||
|
pos.fast_copy(sp->pos);
|
||||||
CheckInfo ci(pos);
|
CheckInfo ci(pos);
|
||||||
SearchStack* ss = sp->sstack[threadID];
|
SearchStack* ss = sp->sstack[threadID];
|
||||||
Value value = -VALUE_INFINITE;
|
Value value = -VALUE_INFINITE;
|
||||||
@@ -2986,6 +2988,9 @@ namespace {
|
|||||||
for (i = 0; i < ActiveThreads; i++)
|
for (i = 0; i < ActiveThreads; i++)
|
||||||
splitPoint->slaves[i] = 0;
|
splitPoint->slaves[i] = 0;
|
||||||
|
|
||||||
|
// Detach splitPoint Position from the master one
|
||||||
|
splitPoint->pos.detach();
|
||||||
|
|
||||||
// Copy the tail of current search stack to the master thread
|
// Copy the tail of current search stack to the master thread
|
||||||
memcpy(splitPoint->sstack[master] + ply - 1, sstck + ply - 1, 3 * sizeof(SearchStack));
|
memcpy(splitPoint->sstack[master] + ply - 1, sstck + ply - 1, 3 * sizeof(SearchStack));
|
||||||
Threads[master].splitPoint = splitPoint;
|
Threads[master].splitPoint = splitPoint;
|
||||||
|
|||||||
Reference in New Issue
Block a user