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>2016-11-17 22:18:39 -0800
commit169454f5613dff38a6159166467b43a163c81e00 (patch)
tree20f76b66039cbdc854e8d0200b6716899f473b22 /src/test
parentf144d04fce0ba0cee4bf194518f5959e8ef95405 (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]);
}