mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00: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:
parent
84ec1f7331
commit
c2df60048e
1 changed files with 7 additions and 2 deletions
|
@ -1813,7 +1813,8 @@ namespace {
|
|||
assert(threadID >= 0 && threadID < ActiveThreads);
|
||||
assert(ActiveThreads > 1);
|
||||
|
||||
Position pos = Position(sp->pos);
|
||||
Position pos;
|
||||
pos.fast_copy(sp->pos);
|
||||
CheckInfo ci(pos);
|
||||
SearchStack* ss = sp->sstack[threadID];
|
||||
Value value = -VALUE_INFINITE;
|
||||
|
@ -1955,7 +1956,8 @@ namespace {
|
|||
assert(threadID >= 0 && threadID < ActiveThreads);
|
||||
assert(ActiveThreads > 1);
|
||||
|
||||
Position pos = Position(sp->pos);
|
||||
Position pos;
|
||||
pos.fast_copy(sp->pos);
|
||||
CheckInfo ci(pos);
|
||||
SearchStack* ss = sp->sstack[threadID];
|
||||
Value value = -VALUE_INFINITE;
|
||||
|
@ -2986,6 +2988,9 @@ namespace {
|
|||
for (i = 0; i < ActiveThreads; i++)
|
||||
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
|
||||
memcpy(splitPoint->sstack[master] + ply - 1, sstck + ply - 1, 3 * sizeof(SearchStack));
|
||||
Threads[master].splitPoint = splitPoint;
|
||||
|
|
Loading…
Add table
Reference in a new issue