Function SDL_GetOriginalMemoryFunctions

pub unsafe extern "C" fn SDL_GetOriginalMemoryFunctions(
    malloc_func: *mut Option<unsafe extern "C" fn(_: usize) -> *mut c_void>,
    calloc_func: *mut Option<unsafe extern "C" fn(_: usize, _: usize) -> *mut c_void>,
    realloc_func: *mut Option<unsafe extern "C" fn(_: *mut c_void, _: usize) -> *mut c_void>,
    free_func: *mut Option<unsafe extern "C" fn(_: *mut c_void)>,
)
Available on crate feature dep_sdl3 only.
Expand description

Get the original set of SDL memory functions.

This is what SDL_malloc and friends will use by default, if there has been no call to SDL_SetMemoryFunctions. This is not necessarily using the C runtime’s malloc functions behind the scenes! Different platforms and build configurations might do any number of unexpected things.

§Parameters

  • malloc_func: filled with malloc function.
  • calloc_func: filled with calloc function.
  • realloc_func: filled with realloc function.
  • free_func: filled with free function.

§Thread safety

It is safe to call this function from any thread.

§Availability

This function is available since SDL 3.2.0.