diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gc.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2015-04-24 Kaz Kylheku <kaz@kylheku.com> + * gc.c (make_obj, gc): The check for insufficient space in freshobj + array after a gc is moved into the gc function. + +2015-04-24 Kaz Kylheku <kaz@kylheku.com> + * gc.c (gc): Minor off-by-one: compare gc_counter to FULL_GC_INTERVAL rather than FULL_GC_INTERVAL - 1, since it is pre-incremented. @@ -173,8 +173,6 @@ val make_obj(void) malloc_delta >= opt_gc_delta) { gc(); - if (freshobj_idx >= FRESHOBJ_VEC_SIZE) - full_gc = 1; prev_malloc_bytes = malloc_bytes; } #else @@ -665,10 +663,13 @@ void gc(void) printf("sweep: freed %d full_gc == %d exhausted == %d\n", (int) swept, full_gc, exhausted); #endif - if (++gc_counter >= FULL_GC_INTERVAL) { + if (++gc_counter >= FULL_GC_INTERVAL || + freshobj_idx >= FRESHOBJ_VEC_SIZE) + { full_gc_next_time = 1; gc_counter = 0; } + if (exhausted && full_gc && swept < 3 * HEAP_SIZE / 4) more(); #else |