Function set_allocator

Source
pub unsafe fn set_allocator(
    new_malloc: Option<unsafe extern "C" fn(size: usize) -> *mut c_void>,
    new_calloc: Option<unsafe extern "C" fn(nmemb: usize, size: usize) -> *mut c_void>,
    new_realloc: Option<unsafe extern "C" fn(ptr: *mut c_void, size: usize) -> *mut c_void>,
    new_free: Option<unsafe extern "C" fn(ptr: *mut c_void)>,
)
Expand description

Sets the memory allocation functions that the core library should use.

ยงSafety

This function uses FFI and mutates a static global.