Skip to main content

SDL_realloc_func

Type Alias SDL_realloc_func 

Source
pub type SDL_realloc_func = Option<unsafe extern "C" fn(mem: *mut c_void, size: usize) -> *mut c_void>;
Expand description

A callback used to implement SDL_realloc().

SDL will always ensure that the passed size is greater than 0.

§Parameters

  • mem: a pointer to allocated memory to reallocate, or NULL.
  • size: the new size of the memory.

§Return value

Returns a pointer to the newly allocated memory, or NULL if allocation failed.

§Thread safety

It should be safe to call this callback from any thread.

§Availability

This datatype is available since SDL 3.2.0.

§See also

Aliased Type§

pub enum SDL_realloc_func {
    None,
    Some(unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void)

Some value of type T.