Trait Allocator

Source
pub trait Allocator {
    // Required methods
    unsafe fn allocate(&mut self, layout: Layout) -> *mut u8;
    unsafe fn deallocate(&mut self, ptr: *mut u8, layout: Layout);
}

Required Methods§

Source

unsafe fn allocate(&mut self, layout: Layout) -> *mut u8

§Safety

See [::alloc::global::GlobalAlloc::alloc].

Source

unsafe fn deallocate(&mut self, ptr: *mut u8, layout: Layout)

§Safety

See [::alloc::global::GlobalAlloc::dealloc].

Implementors§