API reference / Files, memory, and strings
SDL_free
Function, SDL3
Frees memory from an SDL function.
Declaration
#include <SDL3/SDL.h>
void SDL_free(void *mem);Parameters
mem | The memory. NULL is safe. |
Example
SDL_free(cards);See this code run in Read a file. Download the full program (.zip)
Notes
- Use this for memory from
SDL_malloc,SDL_calloc, orSDL_LoadFile. SDL can use a different allocator from your C library.
In SDL2
The name is the same.