Skip to content

Commit

Permalink
green: Don't return the red zone in stack_bounds()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexcrichton committed Mar 15, 2014
1 parent 1218f6d commit bf67783
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/libgreen/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}

Expand Down

5 comments on commit bf67783

@bors
Copy link
Contributor

@bors bors commented on bf67783 Mar 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from thestinger
at alexcrichton@bf67783

@bors
Copy link
Contributor

@bors bors commented on bf67783 Mar 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/issue-12897 = bf67783 into auto

@bors
Copy link
Contributor

@bors bors commented on bf67783 Mar 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/issue-12897 = bf67783 merged ok, testing candidate = 352c5e7

@bors
Copy link
Contributor

@bors bors commented on bf67783 Mar 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 352c5e7

Please sign in to comment.