From 22549f7e02841d5e6fcc6654dbaddcedc485f7e3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 4 Apr 2012 13:28:11 -0700 Subject: * configure (gen_gc): Default to off. Help section added for gen_gc variable. * gc.c (gc): Some missing CONFIG_GEN_GC added. --- ChangeLog | 7 +++++++ configure | 9 ++++++++- gc.c | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3b0c50c8..31e3d337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-04-04 Kaz Kylheku + + * configure (gen_gc): Default to off. + Help section added for gen_gc variable. + + * gc.c (gc): Some missing CONFIG_GEN_GC added. + 2012-04-04 Kaz Kylheku Code cleanup. diff --git a/configure b/configure index b287bcd9..a35a0bb1 100755 --- a/configure +++ b/configure @@ -139,7 +139,7 @@ valgrind=${valgrind-} lit_align=${lit_align-} extra_debugging=${extra_debugging-} debug_support=${debug_support-y} -gen_gc=${gen_gc-y} +gen_gc=${gen_gc-} mpi_version=1.8.6 have_quilt= have_patch= @@ -349,6 +349,13 @@ extra_debugging [$extra_debugging] Use --extra_debugging to configure some additional debugging features, which incur a run-time penalty. + +gen_gc [$gen_gc] + + Use --gen-gc to enable the experimental generational garbage collector. + This is currently disabled by default: a mark-and-sweep garbage collection + strategy is used which performs a full sweep. + ! exit 1 fi diff --git a/gc.c b/gc.c index 458aff42..5bbb88da 100644 --- a/gc.c +++ b/gc.c @@ -534,7 +534,9 @@ static int_ptr_t sweep(void) void gc(void) { val gc_stack_top = nil; +#if CONFIG_GEN_GC int exhausted = (free_list == 0); +#endif if (gc_enabled) { int swept; @@ -552,10 +554,16 @@ void gc(void) mark(&mc, &gc_stack_top); hash_process_weak(); swept = sweep(); +#if CONFIG_GEN_GC if (full_gc && swept < 3 * HEAP_SIZE / 4) more(); else if (!full_gc && swept < HEAP_SIZE / 4 && exhausted) more(); +#else + if (swept < 3 * HEAP_SIZE / 4) + more(); +#endif + #if CONFIG_GEN_GC backptr_idx = 0; freshobj_idx = 0; -- cgit v1.2.3