Change to incremental GC
This commit is contained in:
@@ -49,6 +49,8 @@ void push_stack_frame(LispVal *name, LispVal *fobj, LispVal *args) {
|
||||
frame->args = args;
|
||||
frame->lexenv = Qnil;
|
||||
frame->local_refs.num_refs = 0;
|
||||
frame->marked = false;
|
||||
gc_mark_stack_for_rescan();
|
||||
}
|
||||
|
||||
static void reset_local_refs(struct LocalReferences *refs) {
|
||||
@@ -90,6 +92,10 @@ static void store_local_reference_in_frame(struct StackFrame *frame,
|
||||
refs->blocks[num_full_blocks]
|
||||
->refs[refs->num_refs++ % LOCAL_REFERENCES_BLOCK_LENGTH] = obj;
|
||||
}
|
||||
SET_OBJECT_HAS_LOCAL_REFERENCE(obj, true);
|
||||
// mark the frame for rescan
|
||||
frame->marked = false;
|
||||
gc_mark_stack_for_rescan();
|
||||
}
|
||||
|
||||
void add_local_reference_no_recurse(LispVal *obj) {
|
||||
@@ -186,6 +192,8 @@ void set_stack_evaluated_args(LispVal *args) {
|
||||
assert(the_stack.depth > 0);
|
||||
LISP_STACK_TOP()->evaled_args = true;
|
||||
LISP_STACK_TOP()->args = args;
|
||||
LISP_STACK_TOP()->marked = false;
|
||||
gc_mark_stack_for_rescan();
|
||||
}
|
||||
|
||||
void compact_stack_frame(struct StackFrame *restrict frame) {
|
||||
|
||||
Reference in New Issue
Block a user