1
0
Fork 0

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>
sf_2.3.1_base
Marco Costalba 2010-01-25 12:07:59 +01:00
parent 84ec1f7331
commit c2df60048e
1 changed files with 7 additions and 2 deletions

View File

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