Struct allocator::TlsfByteAllocator
source · pub struct TlsfByteAllocator { /* private fields */ }
Expand description
A TLSF (Two-Level Segregated Fit) memory allocator.
It’s just a wrapper structure of [rlsf::Tlsf
], with FLLEN
and SLLEN
fixed to 28 and 32.
Implementations§
source§impl TlsfByteAllocator
impl TlsfByteAllocator
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new empty TlsfByteAllocator
.
Trait Implementations§
source§impl BaseAllocator for TlsfByteAllocator
impl BaseAllocator for TlsfByteAllocator
source§impl ByteAllocator for TlsfByteAllocator
impl ByteAllocator for TlsfByteAllocator
source§fn alloc(&mut self, layout: Layout) -> AllocResult<NonNull<u8>>
fn alloc(&mut self, layout: Layout) -> AllocResult<NonNull<u8>>
Allocate memory with the given size (in bytes) and alignment.
source§fn dealloc(&mut self, pos: NonNull<u8>, layout: Layout)
fn dealloc(&mut self, pos: NonNull<u8>, layout: Layout)
Deallocate memory at the given position, size, and alignment.
source§fn total_bytes(&self) -> usize
fn total_bytes(&self) -> usize
Returns total memory size in bytes.
source§fn used_bytes(&self) -> usize
fn used_bytes(&self) -> usize
Returns allocated memory size in bytes.
source§fn available_bytes(&self) -> usize
fn available_bytes(&self) -> usize
Returns available memory size in bytes.
Auto Trait Implementations§
impl RefUnwindSafe for TlsfByteAllocator
impl Send for TlsfByteAllocator
impl Sync for TlsfByteAllocator
impl Unpin for TlsfByteAllocator
impl UnwindSafe for TlsfByteAllocator
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