YRC: fixes typo (#25541)

Unrelated CI failures.
This commit is contained in:
Andreas Rumpf
2026-02-24 11:12:28 +01:00
committed by GitHub
parent b51be75613
commit f3d07ff114

View File

@@ -417,7 +417,8 @@ proc collectCycles() =
cfprintf(cstderr, "[collectCycles] begin\n")
yrcCollectorLock:
mergePendingRoots()
if roots.len >= RootsThreshold and mayRunCycleCollect():
if roots.len >= rootsThreshold and mayRunCycleCollect():
let nRoots = roots.len
var j: GcEnv
init j.traceStack
collectCyclesBacon(j, 0)
@@ -434,8 +435,11 @@ proc collectCycles() =
elif rootsThreshold < high(int) div 4:
rootsThreshold = (if rootsThreshold <= 0: defaultThreshold else: rootsThreshold)
rootsThreshold = rootsThreshold div 2 +% rootsThreshold
# Cap growth so threshold doesn't grow without bound when we rarely free cycles
#rootsThreshold = min(rootsThreshold, defaultThreshold *% 16)
# Cost-aware: if this run was expensive (large graph), raise threshold more so we don't run again too soon
if j.touched > nRoots *% 4:
rootsThreshold = rootsThreshold div 2 +% rootsThreshold
rootsThreshold = min(rootsThreshold, defaultThreshold *% 16)
rootsThreshold = min(rootsThreshold, nRoots *% 2)
when logOrc:
cfprintf(cstderr, "[collectCycles] end; freed %ld new threshold %ld\n", j.freed, rootsThreshold)
when defined(nimOrcStats):