Skip to content

Commit

Permalink
fixes #10271 [backport]
Browse files Browse the repository at this point in the history
(cherry picked from commit 451377f)
  • Loading branch information
Araq authored and narimiran committed Jan 14, 2019
1 parent efa7521 commit 98cdfe0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/system/gc_ms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,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):
Expand Down

0 comments on commit 98cdfe0

Please sign in to comment.