mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
rt: Refactor record_sp into task::record_stack_limit
This commit is contained in:
parent
d1fd7d49a7
commit
6da1a3fcd6
@ -367,14 +367,11 @@ rust_scheduler::init_tls() {
|
||||
tls_initialized = true;
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
record_sp(void *limit);
|
||||
|
||||
void
|
||||
rust_scheduler::place_task_in_tls(rust_task *task) {
|
||||
int result = pthread_setspecific(task_key, task);
|
||||
assert(!result && "Couldn't place the task in TLS!");
|
||||
record_sp(task->stk->data + RED_ZONE_SIZE);
|
||||
task->record_stack_limit();
|
||||
}
|
||||
|
||||
rust_task *
|
||||
|
@ -576,16 +576,20 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
|
||||
new_sp = align_down(new_sp - (args_sz + sizeof_retaddr));
|
||||
new_sp += sizeof_retaddr;
|
||||
memcpy(new_sp, args_addr, args_sz);
|
||||
record_sp(stk_seg->data + RED_ZONE_SIZE);
|
||||
record_stack_limit();
|
||||
return new_sp;
|
||||
}
|
||||
|
||||
void
|
||||
rust_task::del_stack() {
|
||||
del_stk(this, stk);
|
||||
record_sp(stk->data + RED_ZONE_SIZE);
|
||||
record_stack_limit();
|
||||
}
|
||||
|
||||
void
|
||||
rust_task::record_stack_limit() {
|
||||
record_sp(stk->data + RED_ZONE_SIZE);
|
||||
}
|
||||
//
|
||||
// Local Variables:
|
||||
// mode: C++
|
||||
|
@ -199,6 +199,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
|
||||
|
||||
void *new_stack(size_t stk_sz, void *args_addr, size_t args_sz);
|
||||
void del_stack();
|
||||
void record_stack_limit();
|
||||
};
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user