[−][src]Struct alloc_cortex_m::CortexMHeap
Implementations
impl CortexMHeap[src]
pub const fn empty() -> CortexMHeap[src]
Crate a new UNINITIALIZED heap allocator
You must initialize this heap using the
init method before using the allocator.
pub unsafe fn init(&self, start_addr: usize, size: usize)[src]
Initializes the heap
This function must be called BEFORE you run any code that makes use of the allocator.
start_addr is the address where the heap will be located.
size is the size of the heap in bytes.
Note that:
-
The heap grows "upwards", towards larger addresses. Thus
end_addrmust be larger thanstart_addr -
The size of the heap is
(end_addr as usize) - (start_addr as usize). The allocator won't use the byte atend_addr.
Safety
Obey these or Bad Stuff will happen.
- This function must be called exactly ONCE.
size > 0
pub fn used(&self) -> usize[src]
Returns an estimate of the amount of bytes in use.
pub fn free(&self) -> usize[src]
Returns an estimate of the amount of bytes available.
Trait Implementations
impl GlobalAlloc for CortexMHeap[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,