default GC can do a sort of heap dump via -d:nimTypeNames and dumpNumberOfInstances()

This commit is contained in:
Andreas Rumpf 2017-01-14 04:00:06 +01:00
commit 823fbd4e40
3 changed files with 37 additions and 3 deletions

View file

@ -88,6 +88,12 @@ type
deepcopy: proc (p: pointer): pointer {.nimcall, benign.}
when defined(nimTypeNames):
name: cstring
nextType: ptr TNimType
instances: int # count the number of instances
sizes: int # sizes of all instances in bytes
PNimType = ptr TNimType
when defined(nimTypeNames):
var nimTypeRoot {.codegenType.}: PNimType
# node.len may be the ``first`` element of a set