From 2215807a7cdf6af20792cac28c9653eb57bd85a7 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 19 Nov 2015 21:18:52 -0500 Subject: [PATCH] WIP, need to get sweep (trace?) working --- gc.c | 5 +++-- runtime.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gc.c b/gc.c index c43cf0f5..29f7be1d 100644 --- a/gc.c +++ b/gc.c @@ -787,7 +787,8 @@ void gc_mut_update(gc_thread_data *thd, object old_obj, object value) ////printf(" for heap object "); //printf("\n"); 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) { //printf("DEBUG - GC async tracing marking heap obj %p ", old_obj); //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; // //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?? //#if GC_DEBUG_CONCISE_PRINTFS printf("sweep done, freed = %d, max_freed = %d, elapsed = %ld\n", diff --git a/runtime.c b/runtime.c index f65df1c7..0d33c4d9 100644 --- a/runtime.c +++ b/runtime.c @@ -2715,7 +2715,7 @@ void GC(void *data, closure cont, object *args, int num_args) 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 // if (heap_grown) {