summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_atom.c
Commit message (Collapse)AuthorAge
* altos/lisp: re-use small framesKeith Packard2017-02-20
| | | | | | | | | 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>
* altos/lisp: Change GC to do moves in batches of 32Keith Packard2017-02-20
| | | | | | This should make it quite a bit faster than doing one at a time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Make sure memmove only happens once per object. Other GC fixesKeith Packard2017-02-20
| | | | | | | | | | | | The memmove may be overlapping, so make sure it happens only once by just checking whether move_size has been set, rather than looking at ao_lisp_moving; that doesn't get set when moving a noted cons as that still needs to be walked at a later time. Fix up the various looping move functions to all use the same pattern. Atom was busted. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Deal with memory compation in the middle of operationsKeith Packard2017-02-20
| | | | | | | | Handle memory compaction in places where we've got pointers into the heap across an allocation operation. Either re-compute the values from managed global references or add new roots across the allocation. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: macros appear to work nowKeith Packard2017-02-20
| | | | | | | | Needed an extra stack frame to stash the pre-macro state. This simplified macro processing quite a bit; a macro now just evaluates the function and then sends that result to be evaluated again. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: working on lexical scopingKeith Packard2017-02-20
| | | | | | Not working yet Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: convert GC to non-recursiveKeith Packard2017-02-20
| | | | | | | Use a boolean array to note cons cells which would otherwise recurse, then loop until that array is empty. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Change GC move APIKeith Packard2017-02-20
| | | | | | | | Pass reference to move API so it can change the values in-place, then let it return '1' when the underlying object has already been moved to shorten GC times. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add lambda support to lispKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Separate out values from atomsKeith Packard2017-02-20
| | | | | | | | | | | This enables changing values of atoms declared as constants, should enable lets, and with some work, even lexical scoping. this required changing the constant computation to run ao_lisp_collect() before dumping the block of constant data, and that uncovered some minor memory manager bugs. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Change lisp objects to use ao_poly everywhere. Add constKeith Packard2017-02-20
| | | | | | | | | | | This makes all lisp objects use 16-bit ints for references so we can hold more stuff in small amounts of memory. Also adds a separate constant pool of lisp objects for builtins, initial atoms and constant lisp code. Now builds (and runs!) on the nucleo-32 boards. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add first lisp bitsKeith Packard2017-02-20
Signed-off-by: Keith Packard <keithp@keithp.com>