WIP, need to get sweep (trace?) working

This commit is contained in:
Justin Ethier 2015-11-19 21:18:52 -05:00
parent 91e018c78b
commit 2215807a7c
2 changed files with 4 additions and 3 deletions

5
gc.c
View file

@ -787,7 +787,8 @@ void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
////printf(" for heap object "); ////printf(" for heap object ");
//printf("\n"); //printf("\n");
gc_mark_gray(thd, old_obj); gc_mark_gray(thd, old_obj);
gc_stack_mark_gray(thd, value); // TODO: need this too???
//gc_stack_mark_gray(thd, value);
} else if (stage == STAGE_TRACING) { } else if (stage == STAGE_TRACING) {
//printf("DEBUG - GC async tracing marking heap obj %p ", old_obj); //printf("DEBUG - GC async tracing marking heap obj %p ", old_obj);
//Cyc_display(old_obj, stdout); //Cyc_display(old_obj, stdout);
@ -1087,7 +1088,7 @@ printf("DEBUG - swap clear %d / mark %d\n", gc_color_clear, gc_color_mark);
gc_stage = STAGE_SWEEPING; gc_stage = STAGE_SWEEPING;
// //
//sweep : //sweep :
//max_freed = gc_sweep(gc_get_heap(), &freed); max_freed = gc_sweep(gc_get_heap(), &freed);
// TODO: grow heap if it is mostly full after collection?? // TODO: grow heap if it is mostly full after collection??
//#if GC_DEBUG_CONCISE_PRINTFS //#if GC_DEBUG_CONCISE_PRINTFS
printf("sweep done, freed = %d, max_freed = %d, elapsed = %ld\n", printf("sweep done, freed = %d, max_freed = %d, elapsed = %ld\n",

View file

@ -2715,7 +2715,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) {