rt: Move valgrind stack configuration out of the hot path

This commit is contained in:
Brian Anderson
2012-02-09 21:27:50 -08:00
parent 81e1564a7d
commit dff256cd19

View File

@@ -389,12 +389,14 @@ rust_task_thread::prepare_c_stack() {
I(this, !extra_c_stack);
if (!cached_c_stack) {
cached_c_stack = create_stack(kernel, C_STACK_SIZE);
config_valgrind_stack(cached_c_stack);
}
}
void
rust_task_thread::unprepare_c_stack() {
if (extra_c_stack) {
unconfig_valgrind_stack(extra_c_stack);
destroy_stack(kernel, extra_c_stack);
extra_c_stack = NULL;
}
@@ -412,7 +414,6 @@ rust_task_thread::borrow_c_stack() {
your_stack = cached_c_stack;
cached_c_stack = NULL;
}
config_valgrind_stack(your_stack);
return your_stack;
}
@@ -420,7 +421,6 @@ rust_task_thread::borrow_c_stack() {
void
rust_task_thread::return_c_stack(stk_seg *stack) {
I(this, !extra_c_stack);
unconfig_valgrind_stack(stack);
if (!cached_c_stack) {
cached_c_stack = stack;
} else {