Method Free
Free(AllocatorHandle, void*, int, int, int)
Frees an allocation.
Declaration
public static void Free(AllocatorManager.AllocatorHandle handle, void* pointer, int itemSizeInBytes, int alignmentInBytes, int items = 1)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.AllocatorHandle | handle | A handle to the allocator. |
void* | pointer | A pointer to the allocated memory. |
int | itemSizeInBytes | The size in bytes of the allocation. |
int | alignmentInBytes | The alignment in bytes (must be a power of two). |
int | items | The number of values that the memory was allocated for. |
Remarks
For some allocators, the size of the allocation must be known to properly deallocate.
Other allocators only need the pointer when deallocating and so will ignore itemSizeInBytes
, alignmentInBytes
and items
.
Free(AllocatorHandle, void*)
Frees an allocation.
Declaration
public static void Free(AllocatorManager.AllocatorHandle handle, void* pointer)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.AllocatorHandle | handle | A handle to the allocator. |
void* | pointer | A pointer to the allocated memory. |
Free<T>(AllocatorHandle, T*, int)
Frees an allocation.
Declaration
public static void Free<T>(AllocatorManager.AllocatorHandle handle, T* pointer, int items = 1) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.AllocatorHandle | handle | A handle to the allocator. |
T* | pointer | A pointer to the allocated memory. |
int | items | The number of values that the memory was allocated for. |
Type Parameters
Name | Description |
---|---|
T | The type of value that the memory was allocated for. |
Remarks
For some allocators, the size of the allocation must be known to properly deallocate.
Other allocators only need the pointer when deallocating and so will ignore T
and items
.