From 65ce505819b0f2e06ed39802d293bff182aedc16 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 7 Jan 2014 13:39:55 +1100 Subject: std::rt: require known stack bounds for all tasks. We just approximate with a 1 or 2 MB stack for native::start. --- src/libstd/rt/mod.rs | 3 ++- src/libstd/rt/task.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 050caef86eb..95e39872b74 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -159,7 +159,8 @@ pub trait Runtime { // you're in. fn spawn_sibling(~self, cur_task: ~Task, opts: TaskOpts, f: proc()); fn local_io<'a>(&'a mut self) -> Option>; - fn stack_bounds(&self) -> Option<(uint, uint)>; // (lo, hi) + /// The (low, high) edges of the current stack. + fn stack_bounds(&self) -> (uint, uint); // (lo, hi) // XXX: This is a serious code smell and this should not exist at all. fn wrap(~self) -> ~Any; diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 3efa979e515..6fb1d111015 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -285,7 +285,7 @@ impl Task { /// Returns the stack bounds for this task in (lo, hi) format. The stack /// bounds may not be known for all tasks, so the return value may be /// `None`. - pub fn stack_bounds(&self) -> Option<(uint, uint)> { + pub fn stack_bounds(&self) -> (uint, uint) { self.imp.get_ref().stack_bounds() } } -- cgit 1.4.1-3-g733a5