pub unsafe trait ChainableAlloc {
// Required method
fn claims(&self, ptr: *mut u8, layout: Layout) -> bool;
}Expand description
A trait representing an allocator that another allocator can be chained to.
§Safety
claims must return true if and only if the allocation belongs to this
allocator (as opposed to one further up the chain). This trait is used to decide
which allocator to free from when the user calls deallocate() and related functions.
Required Methods§
Implementors§
impl<const L: usize, const B: usize> ChainableAlloc for Stalloc<L, B>where
Align<B>: Alignment,
SAFETY: Since zero-sized allocations unconditionally succeed, it can be assumed that a zero-sized allocation was allocated by this Stalloc. Otherwise, check whether the pointer is contained within this Stalloc’s buffer.