diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-14 22:46:13 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-14 22:46:13 -0700 |
| commit | bf67783332ff9f9bdf40da2d9dff860964600420 (patch) | |
| tree | 48a64a2e6d91fd1451524c470aa45fbeaf7368e1 | |
| parent | 1218f6db770f75b262b2feb84cffdc13e8461503 (diff) | |
| download | rust-bf67783332ff9f9bdf40da2d9dff860964600420.tar.gz rust-bf67783332ff9f9bdf40da2d9dff860964600420.zip | |
green: Don't return the red zone in stack_bounds()
This is mostly just an implementation detail, and anyone worried about the stack bounds doesn't need to be bothered with the red zone because it's not usable anyway. Closes #12897
| -rw-r--r-- | src/libgreen/task.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libgreen/task.rs b/src/libgreen/task.rs index c6608f0c9db..7c29a6496f9 100644 --- a/src/libgreen/task.rs +++ b/src/libgreen/task.rs @@ -20,14 +20,15 @@ use std::any::Any; use std::cast; -use std::rt::env; +use std::raw; use std::rt::Runtime; +use std::rt::env; use std::rt::local::Local; use std::rt::rtio; +use std::rt::stack; use std::rt::task::{Task, BlockedTask, SendMessage}; use std::task::TaskOpts; use std::unstable::mutex::NativeMutex; -use std::raw; use context::Context; use coroutine::Coroutine; @@ -469,7 +470,9 @@ impl Runtime for GreenTask { let c = self.coroutine.as_ref() .expect("GreenTask.stack_bounds called without a coroutine"); - (c.current_stack_segment.start() as uint, + // Don't return the red zone as part of the usable stack of this task, + // it's essentially an implementation detail. + (c.current_stack_segment.start() as uint + stack::RED_ZONE, c.current_stack_segment.end() as uint) } |
