Skip to content
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

reflow the stack size story #104659

Merged
merged 1 commit into from
Feb 19, 2023
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
6 changes: 4 additions & 2 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@
//!
//! ## Stack size
//!
//! The default stack size is platform-dependent and subject to change. Currently it is 2MB on all
//! Tier-1 platforms. There are two ways to manually specify the stack size for spawned threads:
//! The default stack size is platform-dependent and subject to change.
//! Currently, it is 2 MiB on all Tier-1 platforms.
Copy link
Member

@compiler-errors compiler-errors Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it 2 MiB or 2 MB by default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 MiB seems correct

pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;

pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;

//!
//! There are two ways to manually specify the stack size for spawned threads:
//!
//! * Build the thread with [`Builder`] and pass the desired stack size to [`Builder::stack_size`].
//! * Set the `RUST_MIN_STACK` environment variable to an integer representing the desired stack
Expand Down