summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_atom.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-15 20:18:59 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:51 -0800
commit881161fe1c5fb0e2b1220c30572eb2c45bedbafe (patch)
tree36070649f2e3d46de239f769cc67cc765f3b9c9a /src/lisp/ao_lisp_atom.c
parent994adc7a47cbf3cbf6041eca7430273f8018de08 (diff)
altos/lisp: re-use small frames
This saves a pile more use of the allocator by noting when frames have not been referenced from another frame and freeing them when they go out of scope. Frames with references are left to the allocator to deal with. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_atom.c')
-rw-r--r--src/lisp/ao_lisp_atom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lisp/ao_lisp_atom.c b/src/lisp/ao_lisp_atom.c
index 6705f140..8c9e8ed1 100644
--- a/src/lisp/ao_lisp_atom.c
+++ b/src/lisp/ao_lisp_atom.c
@@ -108,7 +108,7 @@ ao_lisp_atom_init(void)
ao_lisp_frame_global = ao_lisp_frame_new(0);
}
-static ao_poly *
+ao_poly *
ao_lisp_atom_ref(struct ao_lisp_frame *frame, ao_poly atom)
{
ao_poly *ref;
@@ -117,7 +117,7 @@ ao_lisp_atom_ref(struct ao_lisp_frame *frame, ao_poly atom)
ref = ao_lisp_frame_ref(frame, atom);
if (ref)
return ref;
- frame = ao_lisp_poly_frame(frame->next);
+ frame = ao_lisp_poly_frame(frame->prev);
}
if (ao_lisp_frame_global) {
ref = ao_lisp_frame_ref(ao_lisp_frame_global, atom);