Output relocation data size

db4
slava 2008-07-05 03:07:34 -05:00
parent 8321a41db0
commit db0d714eba
1 changed files with 6 additions and 0 deletions

View File

@ -308,6 +308,8 @@ DEFINE_PRIMITIVE(code_room)
/* Dump all code blocks for debugging */
void dump_heap(F_HEAP *heap)
{
CELL size = 0;
F_BLOCK *scan = first_block(heap);
while(scan)
@ -319,9 +321,11 @@ void dump_heap(F_HEAP *heap)
status = "free";
break;
case B_ALLOCATED:
size += object_size(block_to_compiled(scan)->relocation);
status = "allocated";
break;
case B_MARKED:
size += object_size(block_to_compiled(scan)->relocation);
status = "marked";
break;
default:
@ -333,6 +337,8 @@ void dump_heap(F_HEAP *heap)
scan = next_block(heap,scan);
}
printf("%ld bytes of relocation data\n",size);
}
/* Compute where each block is going to go, after compaction */