Skip to main content

EOS_AllocateMemoryFunc

Type Alias EOS_AllocateMemoryFunc 

Source
pub type EOS_AllocateMemoryFunc = Option<unsafe extern "C" fn(SizeInBytes: usize, Alignment: usize) -> *mut c_void>;
Expand description

Function prototype type definition for functions that allocate memory.

Functions passed to EOS_Initialize to serve as memory allocators should return a pointer to the allocated memory.

The returned pointer should have at least SizeInBytes available capacity and the memory address should be a multiple of Alignment. The SDK will always call the provided function with an Alignment that is a power of 2. Allocation failures should return a null pointer.

Aliased Type§

pub enum EOS_AllocateMemoryFunc {
    None,
    Some(unsafe extern "C" fn(usize, usize) -> *mut c_void),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(usize, usize) -> *mut c_void)

Some value of type T.