Skip to content

Haiku: set stack size to 16 MB on Haiku, use 32 MB on other platforms #51756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ struct Output {
}

pub fn main() {
const STACK_SIZE: usize = 32_000_000; // 32MB
let thread_stack_size: usize = if cfg!(target_os = "haiku") {
16_000_000 // 16MB on Haiku
} else {
32_000_000 // 32MB on other platforms
};
rustc_driver::set_sigpipe_handler();
env_logger::init();
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
let res = std::thread::Builder::new().stack_size(thread_stack_size).spawn(move || {
syntax::with_globals(move || {
get_args().map(|args| main_args(&args)).unwrap_or(1)
})
Expand Down