SdlRealloc
Change the size of allocated memory using SDL's memory manager.
The memory returned by this function must be freed with SdlFree and not Delphi's FreeMem.
If ASize
is 0, it will be set to 1.
If AMem
is nil, the behavior of this function is equivalent to SdlMAlloc. Otherwise, the function can have one of three possible outcomes:
- If it returns the same pointer as
AMem
, it means thatAMem
was resized in place without freeing. - If it returns a different non-nil pointer, it means that
AMem
was freed and cannot be dereferenced anymore. - If it returns nil (indicating failure), then
AMem
will remain valid and must still be freed with SdlFree.
Definition
Unit: Neslib.Sdl3.Additional
Parameters
AMem
: Pointer
: A pointer to allocated memory to reallocate, or nil.
ASize
: NativeInt
: The new size of the memory.
Returns
Pointer
: A pointer to the newly allocated memory, or nil if allocation failed.
See Also
Remarks
It is safe to call this method from any thread