Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ae7b0ac

Browse files
committedJun 28, 2012
move reset_stack_limit off C stack (closes rust-lang#2679)
1 parent af2d01e commit ae7b0ac

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed
 

‎src/rt/rust_task.cpp

+5-13
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,6 @@ struct reset_args {
615615

616616
void
617617
reset_stack_limit_on_c_stack(reset_args *args) {
618-
rust_task *task = args->task;
619-
uintptr_t sp = args->sp;
620-
while (!sp_in_stk_seg(sp, task->stk)) {
621-
task->stk = task->stk->prev;
622-
assert(task->stk != NULL && "Failed to find the current stack");
623-
}
624-
task->record_stack_limit();
625618
}
626619

627620
/*
@@ -632,12 +625,11 @@ when unwinding through __morestack).
632625
void
633626
rust_task::reset_stack_limit() {
634627
uintptr_t sp = get_sp();
635-
// Have to do the rest on the C stack because it involves
636-
// freeing stack segments, logging, etc.
637-
// FIXME (#2679): This probably doesn't need to happen on the C
638-
// stack now
639-
reset_args ra = {this, sp};
640-
call_on_c_stack(&ra, (void*)reset_stack_limit_on_c_stack);
628+
while (!sp_in_stk_seg(sp, stk)) {
629+
stk = stk->prev;
630+
assert(stk != NULL && "Failed to find the current stack");
631+
}
632+
record_stack_limit();
641633
}
642634

643635
void

‎src/rt/rust_upcall.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ call_upcall_on_c_stack(rust_task *task, void *args, void *fn_ptr) {
3636
task->call_on_c_stack(args, fn_ptr);
3737
}
3838

39-
extern "C" void record_sp_limit(void *limit);
40-
4139
/**********************************************************************
4240
* Switches to the C-stack and invokes |fn_ptr|, passing |args| as argument.
4341
* This is used by the C compiler to call foreign functions and by other

0 commit comments

Comments
 (0)
Please sign in to comment.