Type Alias mrb_allocf

Source
pub type mrb_allocf = Option<unsafe extern "C" fn(mrb: *mut mrb_state, arg1: *mut c_void, arg2: usize, ud: *mut c_void) -> *mut c_void>;
Expand description

Function pointer type of custom allocator used in @see mrb_open_allocf.

The function pointing it must behave similarly as realloc except:

  • If ptr is NULL it must allocate new space.
  • If s is NULL, ptr must be freed.

See @see mrb_default_allocf for the default implementation.

Aliased Type§

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

Variants§

§1.0.0

None

No value.

§1.0.0

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

Some value of type T.