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