Skip to content

Commit

Permalink
rustc: Obey RUST_MIN_STACK env var
Browse files Browse the repository at this point in the history
A lot of people are hitting stack overflows in rustc. This will make it
easier to experiment with stack size.
  • Loading branch information
brson committed Aug 10, 2013
1 parent c20b906 commit b473ce3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ pub fn monitor(f: ~fn(diagnostic::Emitter)) {
let ch_capture = ch.clone();
let mut task_builder = task::task();
task_builder.supervised();
task_builder.opts.stack_size = Some(STACK_SIZE);

// XXX: Hacks on hacks. If the env is trying to override the stack size
// then *don't* set it explicitly.
if os::getenv("RUST_MIN_STACK").is_none() {
task_builder.opts.stack_size = Some(STACK_SIZE);
}

match do task_builder.try {
let ch = ch_capture.clone();
let ch_capture = ch.clone();
Expand Down

5 comments on commit b473ce3

@bors
Copy link
Contributor

@bors bors commented on b473ce3 Aug 12, 2013

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 brson@b473ce3

@bors
Copy link
Contributor

@bors bors commented on b473ce3 Aug 12, 2013

Choose a reason for hiding this comment

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

merging brson/rust/rustc-stack = b473ce3 into auto

@bors
Copy link
Contributor

@bors bors commented on b473ce3 Aug 12, 2013

Choose a reason for hiding this comment

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

brson/rust/rustc-stack = b473ce3 merged ok, testing candidate = 0679436

@bors
Copy link
Contributor

@bors bors commented on b473ce3 Aug 12, 2013

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 = 0679436

Please sign in to comment.