Debugging

This commit is contained in:
Justin Ethier 2015-11-19 02:51:22 -05:00
parent ee8aec5887
commit fc29269a26
2 changed files with 3 additions and 3 deletions

4
gc.c
View file

@ -325,7 +325,7 @@ size_t gc_sweep(gc_heap *h, size_t *sum_freed_ptr)
size = gc_heap_align(gc_allocated_bytes(p)); size = gc_heap_align(gc_allocated_bytes(p));
//fprintf(stdout, "check object %p, size = %d\n", p, size); //fprintf(stdout, "check object %p, size = %d\n", p, size);
#if GC_DEBUG_CONCISE_PRINTFS //#if GC_DEBUG_CONCISE_PRINTFS
// DEBUG // DEBUG
if (!is_object_type(p)) if (!is_object_type(p))
fprintf(stderr, "sweep: invalid object at %p", p); fprintf(stderr, "sweep: invalid object at %p", p);
@ -334,7 +334,7 @@ size_t gc_sweep(gc_heap *h, size_t *sum_freed_ptr)
if (r && ((char *)p) + size > (char *)r) if (r && ((char *)p) + size > (char *)r)
fprintf(stderr, "sweep: bad size at %p + %d > %p", p, size, r); fprintf(stderr, "sweep: bad size at %p + %d > %p", p, size, r);
// END DEBUG // END DEBUG
#endif //#endif
if (mark(p) == gc_color_clear) { if (mark(p) == gc_color_clear) {
#if GC_DEBUG_PRINTFS #if GC_DEBUG_PRINTFS

View file

@ -2784,7 +2784,7 @@ void GC(void *data, closure cont, object *args, int num_args)
scani++; scani++;
} }
//fprintf(stdout, "DEBUG done minor GC, alloci = %d\n", alloci); fprintf(stdout, "DEBUG done minor GC, alloci = %d\n", alloci);
// // Check if we need to do a major GC // // Check if we need to do a major GC
// if (heap_grown) { // if (heap_grown) {