sdlSimdRealloc function

Pointer<NativeType> sdlSimdRealloc(
  1. Pointer<NativeType> mem,
  2. int len
)

Reallocate memory obtained from SDL_SIMDAlloc

It is not valid to use this function on a pointer from anything but SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, SDL_malloc, memalign, new[], etc.

\param mem The pointer obtained from SDL_SIMDAlloc. This function also accepts NULL, at which point this function is the same as calling SDL_SIMDAlloc with a NULL pointer. \param len The length, in bytes, of the block to allocated. The actual allocated block might be larger due to padding, etc. Passing 0 will return a non-NULL pointer, assuming the system isn't out of memory. \returns a pointer to the newly-reallocated block, NULL if out of memory.

\since This function is available since SDL 2.0.14.

\sa SDL_SIMDGetAlignment \sa SDL_SIMDAlloc \sa SDL_SIMDFree

extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len)

Implementation

Pointer<NativeType> sdlSimdRealloc(Pointer<NativeType> mem, int len) {
  final sdlSimdReallocLookupFunction = libSdl2.lookupFunction<
      Pointer<NativeType> Function(Pointer<NativeType> mem, Uint32 len),
      Pointer<NativeType> Function(
          Pointer<NativeType> mem, int len)>('SDL_SIMDRealloc');
  return sdlSimdReallocLookupFunction(mem, len);
}