summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-16 12:34:14 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:51 -0800
commitc8f9db184cc929ebde845730a6d4b7864e423a84 (patch)
tree9167a510e45d2e913b97cfd851b12536c1e2f74a /src/test
parent8406ddf8f0bd5453d6213973daed35991f80972a (diff)
altos/lisp: Add incremental collection
Realizing that long-lived objects will eventually float to the bottom of the heap, I added a simple hack to the collector that 'remembers' the top of the heap the last time a full collect was run and then runs incremental collects looking to shift only objects above that boundary. That doesn't perfectly capture the bounds of transient objects, but does manage to reduce the amount of time spent not moving persistent objects each time through the collector. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ao_lisp_test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/ao_lisp_test.c b/src/test/ao_lisp_test.c
index bbaa3f9d..720355d2 100644
--- a/src/test/ao_lisp_test.c
+++ b/src/test/ao_lisp_test.c
@@ -101,5 +101,10 @@ main (int argc, char **argv)
ao_lisp_file = NULL;
}
ao_lisp_read_eval_print();
- printf ("%d collects\n", ao_lisp_collects);
+ printf ("collects: full: %d incremental %d\n",
+ ao_lisp_collects[AO_LISP_COLLECT_FULL],
+ ao_lisp_collects[AO_LISP_COLLECT_INCREMENTAL]);
+ printf ("freed: full %d incremental %d\n",
+ ao_lisp_freed[AO_LISP_COLLECT_FULL],
+ ao_lisp_freed[AO_LISP_COLLECT_INCREMENTAL]);
}