summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_make_const.c
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/lisp/ao_lisp_make_const.c
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/lisp/ao_lisp_make_const.c')
-rw-r--r--src/lisp/ao_lisp_make_const.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lisp/ao_lisp_make_const.c b/src/lisp/ao_lisp_make_const.c
index 416a95d9..60bb80f0 100644
--- a/src/lisp/ao_lisp_make_const.c
+++ b/src/lisp/ao_lisp_make_const.c
@@ -147,7 +147,7 @@ ao_lisp_macro_pop(void)
free(m);
}
-#define DBG_MACRO 1
+#define DBG_MACRO 0
#if DBG_MACRO
int macro_scan_depth;
@@ -355,7 +355,7 @@ main(int argc, char **argv)
}
/* Reduce to referenced values */
- ao_lisp_collect();
+ ao_lisp_collect(AO_LISP_COLLECT_FULL);
for (f = 0; f < ao_lisp_frame_num(ao_lisp_frame_global); f++) {
val = ao_has_macro(ao_lisp_frame_global->vals[f].val);