added logic to the M&S GC to detect logical leaks
This commit is contained in:
parent
0f3e1f17e9
commit
c3b0eb5df7
2 changed files with 62 additions and 0 deletions
|
|
@ -25,6 +25,13 @@ when defined(nimTypeNames):
|
|||
c_fprintf(stdout, "[Heap] %s: #%ld; bytes: %ld\n", it.name, it.instances, it.sizes)
|
||||
it = it.nextType
|
||||
|
||||
when defined(nimGcRefLeak):
|
||||
proc oomhandler() =
|
||||
c_fprintf(stdout, "[Heap] ROOTS: #%ld\n", gch.additionalRoots.len)
|
||||
writeLeaks()
|
||||
|
||||
outOfMemHook = oomhandler
|
||||
|
||||
template decTypeSize(cell, t) =
|
||||
# XXX this needs to use atomics for multithreaded apps!
|
||||
when defined(nimTypeNames):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue