leak: report alloc size mismatch
This commit is contained in:
parent
098884981d
commit
1d2ce3583e
1 changed files with 10 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue