sdlMalloc function
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().
\param size the size to allocate. \returns a pointer to the allocated memory, or NULL if allocation failed.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.1.3.
\sa SDL_free \sa SDL_calloc \sa SDL_realloc \sa SDL_aligned_alloc
extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size)
Implementation
Pointer<NativeType> sdlMalloc(int size) {
final sdlMallocLookupFunction = libSdl3.lookupFunction<
Pointer<NativeType> Function(Uint32 size),
Pointer<NativeType> Function(int size)>('SDL_malloc');
return sdlMallocLookupFunction(size);
}