Merge pull request #4894 from hakanderyal/gc-stack-fix

Gc stack fix
This commit is contained in:
Andreas Rumpf 2016-10-13 23:20:45 +02:00 • committed by GitHub
commit c3959ea6c3

View file

@ -79,6 +79,7 @@ template withRegion*(r: MemRegion; body: untyped) =
try:
body
finally:
r = tlRegion
tlRegion = oldRegion
template inc(p: pointer, s: int) =
@ -464,4 +465,10 @@ proc getFreeMem(): int = tlRegion.remaining
proc getTotalMem(): int =
result = tlRegion.totalSize
proc getOccupiedMem*(r: MemRegion): int =
result = r.totalSize - r.remaining
proc getFreeMem*(r: MemRegion): int = r.remaining
proc getTotalMem*(r: MemRegion): int =
result = r.totalSize
proc setStackBottom(theStackBottom: pointer) = discard