Skip to content

Commit b70305f

Browse files
committed
Haiku: set stack size to 16 MB on Haiku, use 32 MB on other platforms
1 parent 3874676 commit b70305f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustdoc/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ struct Output {
103103
}
104104

105105
pub fn main() {
106-
const STACK_SIZE: usize = 32_000_000; // 32MB
106+
let thread_stack_size: usize = if cfg!(target_os = "haiku") {
107+
16_000_000 // 16MB on Haiku
108+
} else {
109+
32_000_000 // 32MB on other platforms
110+
};
107111
rustc_driver::set_sigpipe_handler();
108112
env_logger::init();
109-
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
113+
let res = std::thread::Builder::new().stack_size(thread_stack_size).spawn(move || {
110114
syntax::with_globals(move || {
111115
get_args().map(|args| main_args(&args)).unwrap_or(1)
112116
})

0 commit comments

Comments
 (0)