pub struct Stack { /* private fields */ }
Expand description
A thread stack with optional guard pages.
This structure represents a single allocated stack that can be used by a thread. It handles both the memory allocation and optional guard page protection.
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn size_class(&self) -> StackSizeClass
pub fn size_class(&self) -> StackSizeClass
Get the stack size class.
Sourcepub fn stack_bottom(&self) -> *mut u8
pub fn stack_bottom(&self) -> *mut u8
Get a pointer to the bottom of the stack (highest address).
On most architectures, stacks grow downward, so this is where the stack pointer should be initialized.
Sourcepub fn has_guard_pages(&self) -> bool
pub fn has_guard_pages(&self) -> bool
Check if this stack has guard pages enabled.
Sourcepub fn install_canary(&self, canary: u64)
pub fn install_canary(&self, canary: u64)
Install a stack canary value for overflow detection.
This writes a known pattern at the bottom of the usable stack that can be checked later to detect stack overflow.
§Arguments
canary
- The canary value to write
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more