Mark&Sweep GC: introduce nimTracing define for debugging

This commit is contained in:
Andreas Rumpf 2018-01-19 18:11:46 +01:00
commit 7adf3bf476
2 changed files with 42 additions and 2 deletions

View file

@ -178,7 +178,10 @@ proc writeCell(file: File; msg: cstring, c: PCell) =
let id = c.id
else:
let id = c
when leakDetector:
when defined(nimTypeNames):
c_fprintf(file, "%s %p %d escaped=%ld color=%c of type %s\n",
msg, id, kind, didEscape(c), col, c.typ.name)
elif leakDetector:
c_fprintf(file, "%s %p %d escaped=%ld color=%c from %s(%ld)\n",
msg, id, kind, didEscape(c), col, c.filename, c.line)
else: