Skip to content

Commit 56a7f1e

Browse files
committed
Haiku: the maximum stack size is 16 MB
When one tries to create a thread with a requested stack size larger than 16 MB, the call will fail and the compiler will bail out. Therefore we should limit the size of the thread stack to 16 MB on Haiku.
1 parent 57e13e0 commit 56a7f1e

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)