X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=738955f990f3e43de6d15d96a01d4b17df1910af;hp=ecc53580716e26ee1b3134baac8dd4e4b6f38ea3;hb=27c74c5245f5f5ba1453438dc66a0c951fbbb411;hpb=13c096f839f991c5d0da1d9bf8d95eae6d0c0aa0 diff --git a/src/search.cpp b/src/search.cpp index ecc53580..738955f9 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2660,7 +2660,7 @@ namespace { lock_init(&IOLock, NULL); // Initialize SplitPointStack locks - for (int i = 0; i < MAX_THREADS; i++) + for (i = 0; i < MAX_THREADS; i++) for (int j = 0; j < ACTIVE_SPLIT_POINTS_MAX; j++) { SplitPointStack[i][j].parent = NULL; @@ -2842,8 +2842,7 @@ namespace { } // Pick the next available split point object from the split point stack - splitPoint = SplitPointStack[master] + threads[master].activeSplitPoints; - threads[master].activeSplitPoints++; + splitPoint = &SplitPointStack[master][threads[master].activeSplitPoints]; // Initialize the split point object splitPoint->parent = threads[master].splitPoint; @@ -2865,6 +2864,7 @@ namespace { splitPoint->slaves[i] = 0; threads[master].splitPoint = splitPoint; + threads[master].activeSplitPoints++; // If we are here it means we are not available assert(threads[master].state != THREAD_AVAILABLE);