pub struct StackAllocation { /* private fields */ }Expand description
This object represents a memory area which can be used for a stack.
It is essentially a range of pointers with these additional guarantees: The begin / end pointers must define a stack with proper alignment (at least 8 bytes, preferably 32 bytes) and sufficient size (64 bytes would be sound but much too little for most real-world workloads). The underlying memory must have a static lifetime and must be owned by the object exclusively. No mutable references to that memory must exist. Therefore, a function that gets passed such an object is free to write to arbitrary memory locations in the range.
Implementations§
Source§impl StackAllocation
impl StackAllocation
Sourcepub unsafe fn from_raw_parts(start: *mut usize, end: *mut usize) -> Self
pub unsafe fn from_raw_parts(start: *mut usize, end: *mut usize) -> Self
Unsafely construct a stack allocation
This is mainly useful to construct a stack allocation in some memory region defined in a linker script, for example to place the stack in the SRAM8/9 regions.
§Safety
The caller must ensure that the guarantees that a StackAllocation provides are upheld.
Trait Implementations§
Source§impl Debug for StackAllocation
impl Debug for StackAllocation
Auto Trait Implementations§
impl !Send for StackAllocation
impl !Sync for StackAllocation
impl Freeze for StackAllocation
impl RefUnwindSafe for StackAllocation
impl Unpin for StackAllocation
impl UnsafeUnpin for StackAllocation
impl UnwindSafe for StackAllocation
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
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more