Struct heapless::pool::Pool [−][src]
pub struct Pool<T> { /* fields omitted */ }
Expand description
A lock-free memory pool
Implementations
Claims a memory block from the pool
Returns None
when the pool is observed as exhausted
NOTE: This method does not have bounded execution time because it contains a CAS loop
Returns a memory block to the pool
NOTE: T
’s destructor (if any) will run on value
iff S = Init
NOTE: This method does not have bounded execution time because it contains a CAS loop
Increases the capacity of the pool
This method might not fully utilize the given memory block due to alignment requirements.
This method returns the number of new blocks that can be allocated.
pub fn grow_exact<A>(&self, memory: &'static mut MaybeUninit<A>) -> usize where
A: AsMutSlice<Element = Node<T>>,
pub fn grow_exact<A>(&self, memory: &'static mut MaybeUninit<A>) -> usize where
A: AsMutSlice<Element = Node<T>>,
Increases the capacity of the pool
Unlike Pool.grow
this method fully utilizes the given
memory block
Trait Implementations
Auto Trait Implementations
Blanket Implementations
pub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
pub fn from(t: T) -> T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
pub fn into(self) -> U
Performs the conversion.