Type Definition rust_hawktracer::realloc_function [−][src]
type realloc_function = Option<unsafe extern "C" fn(ptr: *mut c_void, size: usize, user_data: *mut c_void) -> *mut c_void>;
Callback function for a custom allocator.
HawkTracer requires only one function, which depending on parameter values, performs: alloc, free, and realloc operations.
To allocate memory, @p ptr must be NULL. To free memory, @p size must be equal to 0. To realloc memory, @p size must be greater than 0, and @p ptr must not be NULL.
@param ptr a pointer to a memory block for alloc/realloc/free operations. @param size a size of memory block to allocate for alloc/realloc operations. @param user_data an user data specified in ht_allocator_set().
@return a pointer to allocated memory block for alloc/realloc operations.