Skip to content

Commit

Permalink
fix #10488 GC memory leak regression (#10498)
Browse files Browse the repository at this point in the history
* fix #10488 GC memory leak regression

* re-enable gch.stack.bottom.repr but only inside when defined(logGC)
  • Loading branch information
timotheecour authored and Araq committed Jan 30, 2019
1 parent b2a5195 commit e98bd3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/system/gc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,10 @@ when not defined(useNimRtl):
for stack in items(gch.stack):
result.add "[GC] stack " & stack.bottom.repr & "[GC] max stack size " & cast[pointer](stack.maxStackSize).repr & "\n"
else:
result.add "[GC] stack bottom: " & gch.stack.bottom.repr
# this caused memory leaks, see #10488 ; find a way without `repr`
# maybe using a local copy of strutils.toHex or snprintf
when defined(logGC):
result.add "[GC] stack bottom: " & gch.stack.bottom.repr
result.add "[GC] max stack size: " & $gch.stat.maxStackSize & "\n"

{.pop.} # profiler: off, stackTrace: off

0 comments on commit e98bd3a

Please sign in to comment.