Trait iobuf::Allocator [] [src]

pub trait Allocator: Sync + Send {
    fn allocate(&self, len: usize, align: usize) -> *mut u8;
fn deallocate(&self, ptr: NonZero<*mut u8>, len: usize, align: usize); }

Used to provide custom memory to Iobufs, instead of just using the heap.

Required Methods

Allocates len bytes of memory, with an alignment of align.

Deallocates memory allocated by allocate.

Implementors