[][src]Trait alloc_many::Alloc

pub unsafe trait Alloc {
    unsafe fn alloc(layout: Layout) -> *mut u8;
unsafe fn dealloc(ptr: *mut u8, layout: Layout);
unsafe fn alloc_zeroed(layout: Layout) -> *mut u8;
unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8; }

Singleton version of core::alloc::GlobalAlloc

Required methods

unsafe fn alloc(layout: Layout) -> *mut u8

Returns a pointer meeting the size and alignment guarantees of layout

Singleton version of core::alloc::GlobalAlloc::alloc

unsafe fn dealloc(ptr: *mut u8, layout: Layout)

Deallocate the memory referenced by ptr

Singleton version of core::alloc::GlobalAlloc::dealloc

unsafe fn alloc_zeroed(layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned.

Singleton version of core::alloc::GlobalAlloc::alloc_zeroed

unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8

Shrink or grow a block of memory to the given new_size. The block is described by the given ptr pointer and layout.

Singleton version of core::alloc::GlobalAlloc::realloc

Loading content...

Implementors

Loading content...