diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-26 22:33:03 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-26 22:33:03 +0100 |
commit | 1d2ce3583ec377f16a1f801f624344de99bc9ddc (patch) | |
tree | b998d0ede590edb3bb064a4287e4f7f91fad0430 /sys/lib/acid | |
parent | 098884981d07ebbb4aabb55aac23c091f18114bb (diff) |
leak: report alloc size mismatch
Diffstat (limited to 'sys/lib/acid')
-rw-r--r-- | sys/lib/acid/leak | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/lib/acid/leak b/sys/lib/acid/leak index e03d34d01..33b8f68b7 100644 --- a/sys/lib/acid/leak +++ b/sys/lib/acid/leak @@ -9,12 +9,21 @@ dumppool(p, sum) complex Pool p; a = p.arenalist; + allocsize = 0; + print("A: ", p.arenalist\A, "\n"); while a != 0 do { complex Arena a; dumparena(a, sum); a = a.down; } + if sum then { + emitsum(); + } + + if allocsize != p.curalloc then { + print("found alloc size mismatch ", allocsize, " != ", p.curalloc, "\n"); + } } defn @@ -91,6 +100,7 @@ dumpblock(addr, sum) x = fmt(addr+sizeofBhdr, 'X'); if addr.magic == ALLOC_MAGIC then { + allocsize = allocsize+a.size; // for mallocalign() while *x == ALIGN_MAGIC do { x = x + 4; @@ -199,7 +209,6 @@ blocksummary() { print("==BLOCK BEGIN==\n"); dumppool(*mainmem, 1); - emitsum(); print("==BLOCK END==\n"); } |