summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-04 13:28:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-04 13:28:11 -0700
commit22549f7e02841d5e6fcc6654dbaddcedc485f7e3 (patch)
treed5c9bbb90f439993820c5668940d8fc3fb24f0eb
parent546385def966f1baa475ab1552394f60a3f61a86 (diff)
downloadtxr-22549f7e02841d5e6fcc6654dbaddcedc485f7e3.tar.gz
txr-22549f7e02841d5e6fcc6654dbaddcedc485f7e3.tar.bz2
txr-22549f7e02841d5e6fcc6654dbaddcedc485f7e3.zip
* configure (gen_gc): Default to off.
Help section added for gen_gc variable. * gc.c (gc): Some missing CONFIG_GEN_GC added.
-rw-r--r--ChangeLog7
-rwxr-xr-xconfigure9
-rw-r--r--gc.c8
3 files changed, 23 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b0c50c8..31e3d337 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2012-04-04 Kaz Kylheku <kaz@kylheku.com>
+ * 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 <kaz@kylheku.com>
+
Code cleanup.
* gc.c (backptr_oflow): Static variable removed.
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;