void smal_collect_mark_roots() { smal_thread *thr = smal_thread_self(); // fprintf(stderr, " mark_roots: stack [@%p,@%p)\n", thr->top_of_stack, thr->bottom_of_stack); smal_mark_ptr_range(0, thr->top_of_stack, thr->bottom_of_stack); smal_mark_ptr(0, _tort); smal_mark_ptr_range(0, _tort, _tort + 1); smal_roots_mark_chain(); }
void smal_collect() { smal_thread *thr = smal_thread_self(); void *top_of_stack = 0; smal_FLUSH_REGISTER_WINDOWS; setjmp(thr->registers._jb); getcontext(&thr->registers._ucontext); smal_collect_before_inner(&top_of_stack); _smal_collect_inner(); }
void smal_collect_before_inner(void *top_of_stack) { smal_thread *thr = smal_thread_self(); thr->top_of_stack = top_of_stack; thr->bottom_of_stack = tort_(stack_bottom); }