Skip to content

Commit 2bb390b

Browse files
authored
Rollup merge of #61683 - nielx:haiku-stack-limit, r=nagisa
Haiku: the maximum stack size is 16 MB This keeps the compiler from crashing every time it is invoked. No functional change on other platforms. This patch is similar to the limitation that is in the [librustdoc/lib.rs](https://github.com/rust-lang/rust/blob/57e13e0325c1d41161a31de1f8520538ec2c575c/src/librustdoc/lib.rs#L89).
2 parents e181139 + 56a7f1e commit 2bb390b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc_interface/util.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ pub fn create_session(
121121
}
122122

123123
// Temporarily have stack size set to 32MB to deal with various crates with long method
124-
// chains or deep syntax trees.
124+
// chains or deep syntax trees, except when on Haiku.
125125
// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line
126-
const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB
126+
#[cfg(not(target_os = "haiku"))]
127+
const STACK_SIZE: usize = 32 * 1024 * 1024;
128+
129+
#[cfg(target_os = "haiku")]
130+
const STACK_SIZE: usize = 16 * 1024 * 1024;
127131

128132
fn get_stack_size() -> Option<usize> {
129133
// FIXME: Hacks on hacks. If the env is trying to override the stack size

0 commit comments

Comments
 (0)