diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-08 15:28:25 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-09 19:00:15 -0800 |
| commit | e0d5b92b84424b5b1dbd2dec7d32e92e1550832b (patch) | |
| tree | 82e9a9ba272b53b0c87871503ec8fb649cca12ee /src/rt/rust_task.cpp | |
| parent | 2983e77383edd852bb30a022e4599e7c42670ac5 (diff) | |
| download | rust-e0d5b92b84424b5b1dbd2dec7d32e92e1550832b.tar.gz rust-e0d5b92b84424b5b1dbd2dec7d32e92e1550832b.zip | |
rt: Begin moving stack-building functions to rust_stack.cpp
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 9443d4f3706..79b3d873e88 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -2,9 +2,6 @@ #include "rust_internal.h" #include "rust_cc.h" -#include "vg/valgrind.h" -#include "vg/memcheck.h" - #ifndef __WIN32__ #include <execinfo.h> #endif @@ -60,12 +57,6 @@ #endif #endif -// A value that goes at the end of the stack and must not be touched -const uint8_t stack_canary[] = {0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD}; - static size_t get_next_stk_size(rust_task_thread *thread, rust_task *task, size_t min, size_t current, size_t requested) { @@ -90,38 +81,6 @@ get_next_stk_size(rust_task_thread *thread, rust_task *task, // Task stack segments. Heap allocated and chained together. -static void -config_valgrind_stack(stk_seg *stk) { - stk->valgrind_id = - VALGRIND_STACK_REGISTER(&stk->data[0], - stk->end); -#ifndef NVALGRIND - // Establish that the stack is accessible. This must be done when reusing - // old stack segments, since the act of popping the stack previously - // caused valgrind to consider the whole thing inaccessible. - size_t sz = stk->end - (uintptr_t)&stk->data[0]; - VALGRIND_MAKE_MEM_UNDEFINED(stk->data + sizeof(stack_canary), - sz - sizeof(stack_canary)); -#endif -} - -static void -unconfig_valgrind_stack(stk_seg *stk) { -VALGRIND_STACK_DEREGISTER(stk->valgrind_id); -} - -static void -add_stack_canary(stk_seg *stk) { - memcpy(stk->data, stack_canary, sizeof(stack_canary)); - assert(sizeof(stack_canary) == 16 && "Stack canary was not the expected size"); -} - -static void -check_stack_canary(stk_seg *stk) { - assert(!memcmp(stk->data, stack_canary, sizeof(stack_canary)) - && "Somebody killed the canary"); -} - // The amount of stack in a segment available to Rust code static size_t user_stack_size(stk_seg *stk) { |
