Added debugging

This commit is contained in:
Justin Ethier 2015-11-30 23:00:30 -05:00
parent b5849e10ed
commit 7276eea773
2 changed files with 7 additions and 1 deletions

6
gc.c
View file

@ -932,6 +932,9 @@ void gc_collector_trace()
while (m->last_read < m->last_write) {
clean = 0;
(m->last_read)++;
printf("gc_mark_black mark buffer %p, last_read = %d last_write = %d\n",
(m->mark_buffer)[m->last_read],
m->last_read, m->last_write);
gc_mark_black((m->mark_buffer)[m->last_read]);
gc_empty_collector_stack();
}
@ -1006,6 +1009,9 @@ void gc_mark_black(object obj)
mark(obj) = markColor;
printf("marked %p %d\n", obj, markColor);
}
else {
printf("not marking stack obj %p %d\n", obj, markColor);
}
}
}

View file

@ -2441,7 +2441,7 @@ void gc_mark_globals()
printf("(gc_mark_globals heap: %p size: %d)\n", h, (unsigned int)gc_heap_total_size(h));
#endif
// Mark global variables
printf("Cyc_global_variables %p\n");
printf("Cyc_global_variables %p\n", Cyc_global_variables);
gc_mark_black(Cyc_global_variables); // Internal global used by the runtime
// Marking it ensures all glos are marked
{