1
Fork 0

Rollup merge of #138757 - rust-wasi-web:wasi-thread-stack-size, r=alexcrichton

wasm: increase default thread stack size to 1 MB

The default stack size for the [main thread is 1 MB as specified by linker options](38cf49dde8/compiler/rustc_target/src/spec/base/wasm.rs (L14)).
However, the default stack size for threads was only 64 kB.

This is surprisingly small and thus we increase it to 1 MB to match the main thread.
This commit is contained in:
Matthias Krüger 2025-03-29 11:43:46 +01:00 committed by GitHub
commit c82b88b009
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ cfg_if::cfg_if! {
}
}
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 1024;
impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements

View file

@ -6,7 +6,7 @@ use crate::time::Duration;
pub struct Thread(!);
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 1024;
impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements