diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-12-17 16:45:13 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-12-20 20:15:09 -0800 |
| commit | aeadc6269ef76f4425a49d892ceac7ea311ef5c1 (patch) | |
| tree | e62356f817552b6430f43b6c72964325791418d1 /src/rt | |
| parent | 128621be97d425a1d19e6640c8aee4fb6fca430b (diff) | |
| download | rust-aeadc6269ef76f4425a49d892ceac7ea311ef5c1.tar.gz rust-aeadc6269ef76f4425a49d892ceac7ea311ef5c1.zip | |
wip
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/circular_buffer.h | 2 | ||||
| -rw-r--r-- | src/rt/rust_task.cpp | 12 | ||||
| -rw-r--r-- | src/rt/rust_task.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/rt/circular_buffer.h b/src/rt/circular_buffer.h index f06e700b2f8..ae08c0c6074 100644 --- a/src/rt/circular_buffer.h +++ b/src/rt/circular_buffer.h @@ -7,7 +7,7 @@ class circular_buffer : public kernel_owned<circular_buffer> { - static const size_t INITIAL_CIRCULAR_BUFFER_SIZE_IN_UNITS = 8; + static const size_t INITIAL_CIRCULAR_BUFFER_SIZE_IN_UNITS = 1; static const size_t MAX_CIRCULAR_BUFFER_SIZE = 1 << 24; public: diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 2e6c41a8e79..89570782942 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -404,6 +404,9 @@ rust_task::yield(size_t time_in_us, bool *killed) { *killed = true; } + // We're not going to need any extra stack for a while + clear_stack_cache(); + yield_timer.reset_us(time_in_us); // Return to the scheduler. @@ -747,6 +750,15 @@ rust_task::del_stack() { } void +rust_task::clear_stack_cache() { + A(sched, stk != NULL, "Expected to have a stack"); + if (stk->prev != NULL) { + free_stk(this, stk->prev); + stk->prev = NULL; + } +} + +void rust_task::record_stack_limit() { // The function prolog compares the amount of stack needed to the end of // the stack. As an optimization, when the frame size is less than 256 diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 21d20691ac6..ba116c5a7bc 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -203,6 +203,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond void reset_stack_limit(); bool on_rust_stack(); void check_stack_canary(); + void clear_stack_cache(); }; // |
