Implements alloc/dealloc counters for better leak debugging. (#8384)
This commit is contained in:
parent
2b6f324929
commit
5ea3b4d581
2 changed files with 16 additions and 0 deletions
|
|
@ -57,6 +57,9 @@ when defined(nimTypeNames):
|
|||
for i in 0 .. n-1:
|
||||
c_fprintf(stdout, "[Heap] %s: #%ld; bytes: %ld\n", a[i][0], a[i][1], a[i][2])
|
||||
c_fprintf(stdout, "[Heap] total number of bytes: %ld\n", totalAllocated)
|
||||
when defined(nimTypeNames):
|
||||
let (allocs, deallocs) = getMemCounters()
|
||||
c_fprintf(stdout, "[Heap] allocs/deallocs: %ld/%ld\n", allocs, deallocs)
|
||||
|
||||
when defined(nimGcRefLeak):
|
||||
proc oomhandler() =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue