Skip to content

SdlAlignedAlloc

Allocate memory aligned to a specific alignment.

The memory returned by this function must be freed with SdlAlignedFree, not SdlFree.

If AAlignment is less than the size of a pointer, it will be increased to match that.

The returned memory address will be a multiple of the alignment value, and the size of the memory allocated will be a multiple of the alignment value.

Definition

Unit: Neslib.Sdl3.Additional

function SdlAlignedAlloc(const AAlignment, ASize: NativeInt): Pointer; inline

Parameters

AAlignment: NativeInt : The alignment of the memory.

ASize: NativeInt : The size to allocate.

Returns

Pointer: A pointer to the aligned memory, or nil if allocation failed.

See Also

Remarks

It is safe to call this function from any thread