mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 05:06:36 +02:00
Added debug traces
This commit is contained in:
parent
604eb682c5
commit
b5849e10ed
2 changed files with 5 additions and 1 deletions
4
gc.c
4
gc.c
|
@ -858,8 +858,10 @@ void gc_mut_cooperate(gc_thread_data *thd)
|
||||||
}
|
}
|
||||||
else if (thd->gc_status == STATUS_SYNC2) {
|
else if (thd->gc_status == STATUS_SYNC2) {
|
||||||
// Mark thread "roots"
|
// Mark thread "roots"
|
||||||
|
printf("gc_cont %p\n", thd->gc_cont);
|
||||||
gc_mark_gray(thd, thd->gc_cont);
|
gc_mark_gray(thd, thd->gc_cont);
|
||||||
for (i = 0; i < thd->gc_num_args; i++) {
|
for (i = 0; i < thd->gc_num_args; i++) {
|
||||||
|
printf("gc_args[%d] %p\n", i, thd->gc_args[i]);
|
||||||
gc_mark_gray(thd, thd->gc_args[i]);
|
gc_mark_gray(thd, thd->gc_args[i]);
|
||||||
}
|
}
|
||||||
thd->gc_alloc_color = ATOMIC_GET(&gc_color_mark);
|
thd->gc_alloc_color = ATOMIC_GET(&gc_color_mark);
|
||||||
|
@ -1016,7 +1018,7 @@ void gc_collector_mark_gray(object parent, object obj)
|
||||||
// could lead to stack corruption.
|
// could lead to stack corruption.
|
||||||
if (is_object_type(obj) && mark(obj) == gc_color_clear) {
|
if (is_object_type(obj) && mark(obj) == gc_color_clear) {
|
||||||
mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj);
|
mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj);
|
||||||
printf("mark gray parent = %p obj = %p\n", parent, obj);
|
printf("mark gray parent = %p (%ld) obj = %p\n", parent, type_of(parent), obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2441,6 +2441,7 @@ void gc_mark_globals()
|
||||||
printf("(gc_mark_globals heap: %p size: %d)\n", h, (unsigned int)gc_heap_total_size(h));
|
printf("(gc_mark_globals heap: %p size: %d)\n", h, (unsigned int)gc_heap_total_size(h));
|
||||||
#endif
|
#endif
|
||||||
// Mark global variables
|
// Mark global variables
|
||||||
|
printf("Cyc_global_variables %p\n");
|
||||||
gc_mark_black(Cyc_global_variables); // Internal global used by the runtime
|
gc_mark_black(Cyc_global_variables); // Internal global used by the runtime
|
||||||
// Marking it ensures all glos are marked
|
// Marking it ensures all glos are marked
|
||||||
{
|
{
|
||||||
|
@ -2449,6 +2450,7 @@ void gc_mark_globals()
|
||||||
cvar_type *c = (cvar_type *)car(l);
|
cvar_type *c = (cvar_type *)car(l);
|
||||||
object glo = *(c->pvar);
|
object glo = *(c->pvar);
|
||||||
if (!nullp(glo)) {
|
if (!nullp(glo)) {
|
||||||
|
printf("global pvar %p\n", glo);
|
||||||
gc_mark_black(glo); // Mark actual object the global points to
|
gc_mark_black(glo); // Mark actual object the global points to
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue