rt: Call register/deregister_valgrind_stack from the stack con/destructors

This commit is contained in:
Brian Anderson
2012-02-10 11:39:29 -08:00
parent 3406da49d9
commit 3af4b2c998
3 changed files with 9 additions and 13 deletions

View File

@@ -567,7 +567,6 @@ rust_task::new_stack(size_t requested_sz) {
LOG(this, mem, "reusing existing stack");
stk = stk->prev;
A(thread, stk->prev == NULL, "Bogus stack ptr");
register_valgrind_stack(stk);
prepare_valgrind_stack(stk);
return;
} else {
@@ -599,7 +598,6 @@ rust_task::new_stack(size_t requested_sz) {
LOGPTR(thread, "stk end", new_stk->end);
stk = new_stk;
register_valgrind_stack(stk);
prepare_valgrind_stack(stk);
total_stack_sz += user_stack_size(new_stk);
}
@@ -628,7 +626,6 @@ rust_task::del_stack() {
old_stk->prev = NULL;
}
deregister_valgrind_stack(old_stk);
if (delete_stack) {
free_stack(old_stk);
A(thread, total_stack_sz == 0, "Stack size should be 0");