Skip to content

Commit

Permalink
Haiku: the maximum stack size is 16 MB, so keep it there on that plat…
Browse files Browse the repository at this point in the history
…form.
  • Loading branch information
nielx committed Jan 27, 2019
1 parent 3f83559 commit 5d72c38
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1461,9 +1461,14 @@ fn parse_crate_attrs<'a>(sess: &'a Session, input: &Input) -> PResult<'a, Vec<as
}

// Temporarily have stack size set to 32MB to deal with various crates with long method
// chains or deep syntax trees.
// chains or deep syntax trees, except when on Haiku
// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line
const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB

#[cfg(not(target_os = "haiku"))]
const STACK_SIZE: usize = 32 * 1024 * 1024;

#[cfg(target_os = "haiku")]
const STACK_SIZE: usize = 16 * 1024 * 1024;

/// Runs `f` in a suitable thread for running `rustc`; returns a `Result` with either the return
/// value of `f` or -- if a panic occurs -- the panic value.
Expand Down

0 comments on commit 5d72c38

Please sign in to comment.