void critical_error(const char* msg, cell tagged) { print_string("You have triggered a bug in Factor. Please report.\n"); print_string("critical_error: "); print_string(msg); print_string(": "); print_cell_hex(tagged); nl(); factorbug(); }
/* Dump all code blocks for debugging */ void dump_heap(F_HEAP *heap) { CELL size = 0; F_BLOCK *scan = first_block(heap); while(scan) { char *status; switch(scan->status) { case B_FREE: 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: status = "invalid"; break; } print_cell_hex((CELL)scan); print_string(" "); print_cell_hex(scan->size); print_string(" "); print_string(status); print_string("\n"); scan = next_block(heap,scan); } print_cell(size); print_string(" bytes of relocation data\n"); }
void fatal_error(const char* msg, cell tagged) { print_string("fatal_error: "); print_string(msg); print_string(": "); print_cell_hex(tagged); nl(); exit(1); }