X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=2244a2f7da805599ea07d260134c52e2ee3e6b16;hp=31de0b01e4979e5f5fd23adff739e000b7d4dcd3;hb=c2df60048e8fbbca5dff66b98e4e0f4bf1413821;hpb=84ec1f7331f402f4ab2e2201b72b3ee378cce659 diff --git a/src/search.cpp b/src/search.cpp index 31de0b01..2244a2f7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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;