fix #10488 GC memory leak regression (#10498)

* fix #10488 GC memory leak regression

* re-enable gch.stack.bottom.repr but only inside when defined(logGC)
This commit is contained in:
Timothee Cour
2019-01-30 00:26:33 -08:00
committed by Andreas Rumpf
parent b2a5195e92
commit e98bd3aceb

View File

@@ -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