diff options
author | Keith Packard <keithp@keithp.com> | 2017-12-19 12:39:20 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-12-19 12:39:20 -0800 |
commit | ed1f7b79abc7400a54b35fbf62c9db6855f9129a (patch) | |
tree | aad2b1c704d4f4a32eb54e46784858ca7cb0bf2f /src/scheme/ao_scheme_frame.c | |
parent | 71fb79492cb955af4bd52e79f1fa69d17e084dbc (diff) |
altos/scheme: Replace per-type indexed stash with poly stash heap
Instead of having a random set of stash arrays with explicit indices
used by callers, just have a general heap. Less error prone, and less code.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/scheme/ao_scheme_frame.c')
-rw-r--r-- | src/scheme/ao_scheme_frame.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/scheme/ao_scheme_frame.c b/src/scheme/ao_scheme_frame.c index a7e5153f..16da62fb 100644 --- a/src/scheme/ao_scheme_frame.c +++ b/src/scheme/ao_scheme_frame.c @@ -250,9 +250,9 @@ ao_scheme_frame_new(int num) frame->num = 0; frame->prev = AO_SCHEME_NIL; frame->vals = AO_SCHEME_NIL; - ao_scheme_frame_stash(0, frame); + ao_scheme_frame_stash(frame); vals = ao_scheme_frame_vals_new(num); - frame = ao_scheme_frame_fetch(0); + frame = ao_scheme_frame_fetch(); if (!vals) return NULL; frame->vals = ao_scheme_frame_vals_poly(vals); @@ -296,9 +296,9 @@ ao_scheme_frame_realloc(struct ao_scheme_frame *frame, int new_num) if (new_num == frame->num) return frame; - ao_scheme_frame_stash(0, frame); + ao_scheme_frame_stash(frame); new_vals = ao_scheme_frame_vals_new(new_num); - frame = ao_scheme_frame_fetch(0); + frame = ao_scheme_frame_fetch(); if (!new_vals) return NULL; vals = ao_scheme_poly_frame_vals(frame->vals); @@ -331,11 +331,11 @@ ao_scheme_frame_add(struct ao_scheme_frame *frame, ao_poly atom, ao_poly val) if (!ref) { int f = frame->num; - ao_scheme_poly_stash(0, atom); - ao_scheme_poly_stash(1, val); + ao_scheme_poly_stash(atom); + ao_scheme_poly_stash(val); frame = ao_scheme_frame_realloc(frame, f + 1); - val = ao_scheme_poly_fetch(1); - atom = ao_scheme_poly_fetch(0); + val = ao_scheme_poly_fetch(); + atom = ao_scheme_poly_fetch(); if (!frame) return AO_SCHEME_NIL; ao_scheme_frame_bind(frame, frame->num - 1, atom, val); |