summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_mem.c
Commit message (Collapse)AuthorAge
* altos/lisp: Make sure memmove only happens once per object. Other GC fixesKeith Packard2016-11-17
| | | | | | | | | | | | 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: Share mark function for mark and moveKeith Packard2016-11-17
| | | | | | | These two operations both wanted to walk the referenced objects; sharing is caring. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Deal with memory compation in the middle of operationsKeith Packard2016-11-17
| | | | | | | | 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: Clean up OS integration bits, add defunKeith Packard2016-11-17
| | | | | | | Provide an abstraction for the OS interface so that it can build more cleanly on Linux and AltOS. Add defun macro. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: working on lexical scopingKeith Packard2016-11-17
| | | | | | Not working yet Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: convert GC to non-recursiveKeith Packard2016-11-17
| | | | | | | 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: more GC issues. add patomKeith Packard2016-11-17
| | | | | | | Use global ao_lisp_stack instead of local stack so that gc moves of that item work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: make sure stack->formals_last gets moved during GCKeith Packard2016-11-17
| | | | | | Failing this leads to broken formals chains Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lisp: Change GC move APIKeith Packard2016-11-17
| | | | | | | | 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/lisp: Separate out values from atomsKeith Packard2016-11-17
| | | | | | | | | | | 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 Packard2016-11-17
| | | | | | | | | | | 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>
* altos: Add lisp readerKeith Packard2016-11-17
|
* Add first lisp bitsKeith Packard2016-11-17
Signed-off-by: Keith Packard <keithp@keithp.com>