| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
Don't crash when printing null stack this way.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Get rid of the remaining duplicate defines.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Save some text space.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Collect memory, return amount free.
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>
|
|
|
|
|
|
| |
It's not very exciting, but it's still legal
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Saves some memory.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This avoids having different values in different files, which wasn't useful.
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>
|
|
|
|
|
|
|
| |
Instead of always returning 'nil', let while return the last body
value.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This lets all of these execute more than one sexpr, returning the
value of the last.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Makes debugging easier
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Useful for debugging
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Cut&paste error.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
No-one sets frame->_num to 0xff to hit these
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>
|
|
|
|
|
|
| |
This allows for (defun foo())
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>
|
|
|
|
|
|
| |
Added nth, or and and.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Entries from the params are bound to the formals with whatever
remaining formals there are bound to the last argument as a list.
This makes writing functions a bit easier.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Need to look at immediate lambdas as well, and also deal with
recursive functions by checking for recursion at each atom
dereference.
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>
|
|
|
|
|
|
| |
Remove exti from the build list to make things fit.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This assumes that macros are all pure functions, which should be true
for syntactic macros.
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>
|
|
|
|
|
|
|
|
| |
This sticks a few globals past the end of the heap and then asks the
OS to save the heap. On restore, the heap is re-populated by the OS
and then various global variables reset.
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 functions are pretty large and end up consuming quite a bit of
space if inlined everywhere they are used.
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>
|
|
|
|
|
|
| |
lots more builtins
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>
|
|
|
|
|
|
| |
Also make it an exception to hit eof in the middle of an sexpr.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
No need to open code this sequence of operations.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Progn as a builtin will help with tail-recursion.
while provides for loops until tail-recursion works :-)
read and eval are kinda useful.
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|