From e98bd3acebb21b14894e7f12c0b7f9e79a3f4c9c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 30 Jan 2019 00:26:33 -0800 Subject: [PATCH] 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) --- lib/system/gc.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 416827f21f3df..018197c1eb982 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -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