Skip to content

Commit

Permalink
Rollup merge of #93504 - solid-rs:fix-kmc-solid-stack-size, r=nagisa
Browse files Browse the repository at this point in the history
kmc-solid: Increase the default stack size

This PR increases the default minimum stack size on the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets to 64KiB (Arm) and 128KiB (AArch64).

This value was chosen as a middle ground between supporting a relatively complex program (e.g., an application using a full-fledged off-the-shelf web server framework) with no additional configuration and minimizing resource consumption for the embedded platform that doesn't support lazily-allocated pages nor over-commitment (i.e., wasted stack spaces are wasted physical memory). If the need arises, the users can always set the `RUST_MIN_STACK` environmental variable to override the default stack size or use the platform API directly.
  • Loading branch information
matthiaskrgr authored Jan 31, 2022
2 parents 4aee623 + 1a77d62 commit 8968b20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/sys/itron/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const LIFECYCLE_DETACHED_OR_JOINED: usize = usize::MAX;
const LIFECYCLE_EXITED_OR_FINISHED_OR_JOIN_FINALIZE: usize = usize::MAX;
// there's no single value for `JOINING`

pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * crate::mem::size_of::<usize>();
// 64KiB for 32-bit ISAs, 128KiB for 64-bit ISAs.
pub const DEFAULT_MIN_STACK_SIZE: usize = 0x4000 * crate::mem::size_of::<usize>();

impl Thread {
/// # Safety
Expand Down

0 comments on commit 8968b20

Please sign in to comment.