stumpless_set_realloc

Function stumpless_set_realloc 

Source
pub unsafe extern "C" fn stumpless_set_realloc(
    realloc_func: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: usize) -> *mut c_void>,
) -> Option<unsafe extern "C" fn(realloc_func: *mut c_void, arg1: usize) -> *mut c_void>
Expand description

Sets the function used by the library to reallocate memory.

Thread Safety: MT-Unsafe This function is not thread safe as it changes the memory allocation scheme, which could cause an operation to use the old function for some allocation and the new function for others. If you need to set any of the memory management functions, it should be done before starting multiple threads with access to shared resources.

Async Signal Safety: AS-Unsafe This function is not safe to call from signal handlers for the same reason as it is not thread safe.

Async Cancel Safety: AC-Unsafe This function is not safe to call from threads that may be asynchronously cancelled, as the assignment is not guaranteed to be atomic.

@param realloc_func A pointer to the memory reallocation function that is desired. This function must have the same signature as the standard library \c realloc function (which is the default if this is not called).

@return The new reallocation function.