tree_sitter

Function set_allocator

source
pub unsafe fn set_allocator(
    new_malloc: Option<unsafe extern "C" fn(_: usize) -> *mut c_void>,
    new_calloc: Option<unsafe extern "C" fn(_: usize, _: usize) -> *mut c_void>,
    new_realloc: Option<unsafe extern "C" fn(_: *mut c_void, _: usize) -> *mut c_void>,
    new_free: Option<unsafe extern "C" fn(_: *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.