[][src]Trait basic_allocator::allocators::HeapGrower

pub trait HeapGrower {
    type Err;
    unsafe fn grow_heap(
        &mut self,
        size: usize
    ) -> Result<(*mut u8, usize), Self::Err>; }

Associated Types

type Err

Loading content...

Required methods

unsafe fn grow_heap(
    &mut self,
    size: usize
) -> Result<(*mut u8, usize), Self::Err>

Grow the heap by at least size. Returns a pointer and the size of the memory available at that pointer.

Safety

This is pretty much entirely unsafe.

For this to function properly with the other types in this module:

  • The return value may be (null, 0), indicating allocation failure.
  • The return value may be (ptr, new_size), where new_size >= size, and where the memory pointed to by ptr must be available and untracked by any other rust code, including the allocator itself.
Loading content...

Implementors

impl HeapGrower for SyscallHeapGrower[src]

type Err = MmapError

impl HeapGrower for ToyHeap[src]

type Err = ToyHeapOverflowError

Loading content...