fixes #10271 [backport]

This commit is contained in:
Araq
2019-01-13 14:24:38 +01:00
parent 7f0559b93f
commit 451377f737

View File

@@ -485,8 +485,9 @@ proc collectCTBody(gch: var GcHeap) =
sysAssert(allocInv(gch.region), "collectCT: end")
proc collectCT(gch: var GcHeap; size: int) =
let fmem = getFreeMem(gch.region)
if (getOccupiedMem(gch.region) >= gch.cycleThreshold or
size > getFreeMem(gch.region)) and gch.recGcLock == 0:
size > fmem and fmem > InitialThreshold) and gch.recGcLock == 0:
collectCTBody(gch)
when not defined(useNimRtl):