Table of Contents

Interface INativeMemoryFunctions

Namespace
Sdl3Sharp.Utilities
Assembly
Sdl3Sharp.dll

Represents a set of native memory functions that SDL uses to allocate, free, and reallocate memory

public interface INativeMemoryFunctions

Methods

Calloc(nuint, nuint)

A callback used to implement Calloc(nuint, nuint)

void* Calloc(nuint elementCount, nuint elementSize)

Parameters

elementCount nuint

The number of elements in the array

elementSize nuint

The size of each element of the array

Returns

void*

A pointer to the allocated memory, or null if the allocation failed

Remarks

SDL will always ensure that the passed elementCount and elementSize are both greater than 0.

See Also

Free(void*)

A callback used to implement Free(void*)

void Free(void* memory)

Parameters

memory void*

A pointer to allocated memory

Remarks

SDL will always ensure that the passed memory pointer is a non-null pointer.

See Also

Malloc(nuint)

A callback used to implement Malloc(nuint)

void* Malloc(nuint size)

Parameters

size nuint

The size to allocate

Returns

void*

A pointer to the allocated memory, or null if the allocation failed

Remarks

SDL will always ensure that the passed size is greater than 0.

See Also

Realloc(void*, nuint)

A callback used to implement Realloc(void*, nuint)

void* Realloc(void* memory, nuint newSize)

Parameters

memory void*

A pointer to allocated memory to reallocate, or null

newSize nuint

The new size of the memory

Returns

void*

A pointer to the newly allocated memory, or null if the allocation failed

Remarks

SDL will always ensure that the passed newSize is greater than 0.

See Also