This commit is contained in:
araq
2026-02-23 00:05:59 +01:00
parent 8680aab24c
commit cfdca166fb
2 changed files with 4 additions and 3 deletions

View File

@@ -27,8 +27,9 @@ when defined(gcYrc):
lockState {.threadvar.}: YrcLockState
proc acquireMutatorLock() {.compilerRtl, inl.} =
acquireRead gYrcGlobalLock
lockState = HasMutatorLock
if lockState == HasNoLock:
acquireRead gYrcGlobalLock
lockState = HasMutatorLock
proc releaseMutatorLock() {.compilerRtl, inl.} =
if lockState == HasMutatorLock:

View File

@@ -435,7 +435,7 @@ when defined(nimOrcStats):
proc GC_runOrc* =
yrcCollectorLock:
mergePendingRoots()
if mayRunCycleCollect():
if roots.len > 0 and mayRunCycleCollect():
var j: GcEnv
init j.traceStack
collectCyclesBacon(j, 0)