Skip to content

Commit

Permalink
Increase default stack size in some cases
Browse files Browse the repository at this point in the history
In cases where panic = "unwind" and optimizations are disabled.

In this case, unwinding takes a surprisingly large amount of memory.

Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Sep 25, 2024
1 parent 8c11663 commit 8748f75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crates/sel4-microkit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ macro_rules! declare_protection_domain {
}

#[doc(hidden)]
pub const DEFAULT_STACK_SIZE: usize = 0x10000;
pub const DEFAULT_STACK_SIZE: usize = 1024
* if cfg!(panic = "unwind") && cfg!(debug_assertions) {
128
} else {
64
};

// For macros
#[doc(hidden)]
Expand Down
7 changes: 6 additions & 1 deletion crates/sel4-root-task/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ macro_rules! declare_root_task {
}

#[doc(hidden)]
pub const DEFAULT_STACK_SIZE: usize = 0x10000;
pub const DEFAULT_STACK_SIZE: usize = 1024
* if cfg!(panic = "unwind") && cfg!(debug_assertions) {
128
} else {
64
};

// For macros
#[doc(hidden)]
Expand Down

0 comments on commit 8748f75

Please sign in to comment.