static void atom_move(void *addr)
{
struct ao_lisp_atom *atom = addr;
+ int ret;
for (;;) {
- if (ao_lisp_poly_move(&atom->next, 0))
+ struct ao_lisp_atom *next = ao_lisp_poly_atom(atom->next);
+
+ if (!next)
break;
- atom = ao_lisp_poly_atom(atom->next);
+ ret = ao_lisp_move_memory((void **) &next, atom_size(next));
+ if (next != ao_lisp_poly_atom(atom->next))
+ atom->next = ao_lisp_atom_poly(next);
+ if (ret)
+ break;
+ atom = next;
}
}
return atom;
}
-static struct ao_lisp_frame *ao_lisp_frame_global;
-struct ao_lisp_frame *ao_lisp_frame_current;
+struct ao_lisp_frame *ao_lisp_frame_global;
+struct ao_lisp_frame *ao_lisp_frame_current;
static void
ao_lisp_atom_init(void)
#endif
if (ref)
return *ref;
- return AO_LISP_NIL;
+ return ao_lisp_error(AO_LISP_UNDEFINED, "undefined atom %s", ao_lisp_poly_atom(atom)->name);
}
ao_poly
if (ref)
*ref = val;
else
- ao_lisp_frame_global = ao_lisp_frame_add(ao_lisp_frame_global, atom, val);
+ ao_lisp_frame_add(&ao_lisp_frame_global, atom, val);
return val;
}