pub struct MappedStack { /* private fields */ }Expand description
One private anonymous mapping whose lowest page is an inaccessible guard.
Stacks grow downward on both supported targets, so MappedStack::base is the
initial stack pointer and the guard page catches overflow before it can reach a
neighbouring mapping.
Implementations§
Source§impl MappedStack
impl MappedStack
Sourcepub fn new(usable: usize, identity: u64) -> Result<Self>
pub fn new(usable: usize, identity: u64) -> Result<Self>
Maps at least usable bytes above one guard page and stamps the allocation.
The usable capacity rounds up to whole pages. The identity is assigned by the
allocating owner, normally a StackPool, and never changes.
Sourcepub fn base(&self) -> NonZeroUsize
pub fn base(&self) -> NonZeroUsize
Highest usable address and initial stack pointer, aligned to STACK_ALIGNMENT.
Sourcepub fn limit(&self) -> NonZeroUsize
pub fn limit(&self) -> NonZeroUsize
Lowest address of the mapping, including the guard page.
Sourcepub fn usable_len(&self) -> usize
pub fn usable_len(&self) -> usize
Bytes of accessible stack above the guard page.
Trait Implementations§
Source§impl Debug for MappedStack
impl Debug for MappedStack
Source§impl Drop for MappedStack
impl Drop for MappedStack
impl Send for MappedStack
impl Sync for MappedStack
Auto Trait Implementations§
impl Forget for MappedStack
impl Freeze for MappedStack
impl RefUnwindSafe for MappedStack
impl Unpin for MappedStack
impl UnsafeUnpin for MappedStack
impl UnwindSafe for MappedStack
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