Commit de6a898b authored by simonmar@microsoft.com's avatar simonmar@microsoft.com
Browse files

findSlop: useful function for tracking down excessive slop in gdb

parent 2cf1115c
......@@ -1118,6 +1118,21 @@ void freeExec (void *addr)
#ifdef DEBUG
// Useful for finding partially full blocks in gdb
void findSlop(bdescr *bd);
void findSlop(bdescr *bd)
{
lnat slop;
for (; bd != NULL; bd = bd->link) {
slop = (bd->blocks * BLOCK_SIZE_W) - (bd->free - bd->start);
if (slop > (1024/sizeof(W_))) {
debugBelch("block at %p (bdescr %p) has %ldKB slop\n",
bd->start, bd, slop / (1024/sizeof(W_)));
}
}
}
nat
countBlocks(bdescr *bd)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment