/* Called by landing pads during unwinding to figure out which stack segment we are currently running on and record the stack limit (which was not restored when unwinding through __morestack). */ void rust_task::reset_stack_limit() { I(thread, on_rust_stack()); uintptr_t sp = get_sp(); // Have to do the rest on the C stack because it involves // freeing stack segments, logging, etc. // FIXME: This probably doesn't need to happen on the C // stack now reset_args ra = {this, sp}; call_on_c_stack(&ra, (void*)reset_stack_limit_on_c_stack); }
void rust_task::delete_all_stacks() { I(thread, !on_rust_stack()); // Delete all the stacks. There may be more than one if the task failed // and no landing pads stopped to clean up. I(thread, stk->next == NULL); while (stk != NULL) { stk_seg *prev = stk->prev; free_stack(stk); stk = prev; } }
void rust_task::delete_all_stacks() { assert(!on_rust_stack()); // Delete all the stacks. There may be more than one if the task failed // and no landing pads stopped to clean up. assert(stk->next == NULL); while (stk != NULL) { stk_seg *prev = stk->prev; if (stk->is_big) sched_loop->return_big_stack(stk); else free_stack(stk); stk = prev; } }