-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
Location
https://doc.rust-lang.org/std/thread/#stack-size
Summary
This says
The default stack size for spawned threads is 2 MiB, though this particular stack size is subject to change in the future.
This is not correct, because it implies this is true for all platforms, but each platform sets their own default stack size. Even amongst unices, 2mib isn't always the case.
rust/library/std/src/sys/unix/thread.rs
Lines 14 to 21 in 02cd79a
#[cfg(not(any(target_os = "l4re", target_os = "vxworks", target_os = "espidf")))] | |
pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024; | |
#[cfg(target_os = "l4re")] | |
pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 1024; | |
#[cfg(target_os = "vxworks")] | |
pub const DEFAULT_MIN_STACK_SIZE: usize = 256 * 1024; | |
#[cfg(target_os = "espidf")] | |
pub const DEFAULT_MIN_STACK_SIZE: usize = 0; // 0 indicates that the stack size configured in the ESP-IDF menuconfig system should be used |
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools