Function SDL_malloc

pub unsafe extern "C" fn SDL_malloc(size: usize) -> *mut c_void
Available on crate feature dep_sdl3 only.
Expand description

Allocate uninitialized memory.

The allocated memory returned by this function must be freed with SDL_free().

If size is 0, it will be set to 1.

If you want to allocate memory aligned to a specific alignment, consider using SDL_aligned_alloc().

§Parameters

  • size: the size to allocate.

§Return value

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

§Thread safety

It is safe to call this function from any thread.

§Availability

This function is available since SDL 3.2.0.

§See also