| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
Something about alignment issues.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Save some text space.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
Fortunately, the collector always retains the relative order between
addresses, so we can sort based on the atom address itself. This
reduces the time spent looking for names in larger (e.g. global)
frames.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
This makes move_map faster by skipping all addresses which aren't
changing.
Also changed the interface from address to offset to avoid computing
the offset multiple times.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Saves some memory.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This provides call/cc and makes 'stacks' visible to the application.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
Using ao_lisp_pool - 4 caused the compiler to whinge about computing
an address outside the bounds of the array. Sigh. Restructure the code
to do the adjustment-by-4 in the integer computations instead of the
pointer ones.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Speeds up collect a bit
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Note range of existing chunks to exclude objects outside.
Only look at chunks which have been set to reduce loop cost.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Realizing that long-lived objects will eventually float to the bottom
of the heap, I added a simple hack to the collector that 'remembers'
the top of the heap the last time a full collect was run and then runs
incremental collects looking to shift only objects above that
boundary. That doesn't perfectly capture the bounds of transient
objects, but does manage to reduce the amount of time spent not moving
persistent objects each time through the collector.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Track freed cons cells and stack items from the eval process where
possible so that they can be re-used without needing to collect.
This dramatically reduces the number of collect calls.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
We don't need to mark the whole object now as we're getting
information about where objects are by walking the tree each time
around the loop; ao_lisp_busy is only useful for terminating the walk
now.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This should make it quite a bit faster than doing one at a time.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The CRC is actually of the ROM bits, so we can tell if the restored
image relates to the currently running code.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
These two operations both wanted to walk the referenced objects;
sharing is caring.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Not working yet
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Failing this leads to broken formals chains
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|