mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Compute SplitPoint::spLevel on the fly
And retire a redundant field. This is important also from a concept point of view becuase we want to keep SMP structures as simple as possible with the only strictly necessary data. Verified with dbg_hit_on(sp->spLevel != level) that the values are 100% the same out of more 50K samples. No functional change.
This commit is contained in:
+7
-2
@@ -1604,7 +1604,12 @@ void Thread::idle_loop() {
|
||||
&& sp->slavesCount < MAX_SLAVES_PER_SPLITPOINT
|
||||
&& available_to(Threads[i]))
|
||||
{
|
||||
int score = sp->spLevel * 256 * 256 + sp->slavesCount * 256 - sp->depth * 1;
|
||||
// Compute the recursive split points chain size
|
||||
int level = -1;
|
||||
for (SplitPoint* spp = Threads[i]->activeSplitPoint; spp; spp = spp->parentSplitPoint)
|
||||
level++;
|
||||
|
||||
int score = level * 256 * 256 + sp->slavesCount * 256 - sp->depth * 1;
|
||||
|
||||
if (score < bestScore)
|
||||
{
|
||||
@@ -1618,7 +1623,7 @@ void Thread::idle_loop() {
|
||||
if (bestSp)
|
||||
{
|
||||
sp = bestSp;
|
||||
|
||||
|
||||
// Recheck the conditions under lock protection
|
||||
Threads.mutex.lock();
|
||||
sp->mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user