mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-09 22:17:33 +02:00
Debugging...
This commit is contained in:
parent
2be274d1be
commit
3d41425e88
2 changed files with 26 additions and 3 deletions
|
@ -3,3 +3,11 @@ Phase 2 (gc-dev2) - Change how strings are allocated, to clean up the code and b
|
||||||
Phase 3 (gc-dev3) - Change from using a Cheney-style copying collector to a naive mark&sweep algorithm.
|
Phase 3 (gc-dev3) - Change from using a Cheney-style copying collector to a naive mark&sweep algorithm.
|
||||||
Phase 4 (gc-dev4) - Integrating new tracing GC algorithm, added new thread data argument to runtime.
|
Phase 4 (gc-dev4) - Integrating new tracing GC algorithm, added new thread data argument to runtime.
|
||||||
Phase 5 (gc-dev5) - Require pthreads library, stand cyclone back up using new GC algorithm.
|
Phase 5 (gc-dev5) - Require pthreads library, stand cyclone back up using new GC algorithm.
|
||||||
|
|
||||||
|
|
||||||
|
Debugging notes:
|
||||||
|
__glo_list_91ref -
|
||||||
|
tag is 0
|
||||||
|
car appears corrupt
|
||||||
|
cdr is set to 0x2 during a segfault.
|
||||||
|
how could this have happened? this variable should always be assigned a closure
|
||||||
|
|
21
gc.c
21
gc.c
|
@ -532,9 +532,18 @@ void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
|
||||||
int status = ATOMIC_GET(&gc_status_col),
|
int status = ATOMIC_GET(&gc_status_col),
|
||||||
stage = ATOMIC_GET(&gc_stage);
|
stage = ATOMIC_GET(&gc_stage);
|
||||||
if (thd->gc_status != STATUS_ASYNC) {
|
if (thd->gc_status != STATUS_ASYNC) {
|
||||||
|
printf("DEBUG - GC sync marking heap obj ");
|
||||||
|
Cyc_display(old_obj, stdout);
|
||||||
|
printf(" and new value ");
|
||||||
|
Cyc_display(value, stdout);
|
||||||
|
//printf(" for heap object ");
|
||||||
|
printf("\n");
|
||||||
gc_mark_gray(thd, old_obj);
|
gc_mark_gray(thd, old_obj);
|
||||||
gc_mark_gray(thd, value);
|
gc_mark_gray(thd, value);
|
||||||
} else if (stage == STAGE_TRACING) {
|
} else if (stage == STAGE_TRACING) {
|
||||||
|
printf("DEBUG - GC async tracing marking heap obj ");
|
||||||
|
Cyc_display(old_obj, stdout);
|
||||||
|
printf("\n");
|
||||||
gc_mark_gray(thd, old_obj);
|
gc_mark_gray(thd, old_obj);
|
||||||
}
|
}
|
||||||
// TODO: concerned there may be an issue here with a stack object
|
// TODO: concerned there may be an issue here with a stack object
|
||||||
|
@ -613,7 +622,6 @@ void gc_mark_gray(gc_thread_data *thd, object obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TODO:
|
|
||||||
// TODO: before doing this, may want to debug a bit and see what is
|
// TODO: before doing this, may want to debug a bit and see what is
|
||||||
// being passed to gc_mut_update. see if those objects tend to have
|
// being passed to gc_mut_update. see if those objects tend to have
|
||||||
// any heap refs. may need to add debug code to do that...
|
// any heap refs. may need to add debug code to do that...
|
||||||
|
@ -710,10 +718,17 @@ void gc_mark_black(object obj)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case cvar_tag: {
|
||||||
|
gc_collector_mark_gray( *(((cvar_type *)obj)->pvar) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mark(obj) = markColor;
|
if (mark(obj) != gc_color_red) {
|
||||||
|
// Only blacken objects on the heap
|
||||||
|
mark(obj) = markColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,7 +843,7 @@ void *collector_main(void *arg)
|
||||||
// this is inefficient but it should be good enough to
|
// this is inefficient but it should be good enough to
|
||||||
// at least stand up this collector. then we'll have to
|
// at least stand up this collector. then we'll have to
|
||||||
// come back and improve it
|
// come back and improve it
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue