Class AllocatorManager
Manages custom memory allocators.
Namespace: Unity.Collections
Assembly: solution.dll
Syntax
public static class AllocatorManager
Fields
Name | Description |
---|---|
FirstUserIndex | Index in the global function table of the first user-defined allocator. |
Invalid | Corresponds to Allocator.Invalid. |
MaxNumCustomAllocators | Maximum number of user-defined allocators. |
None | Corresponds to Allocator.None. |
Persistent | Corresponds to Allocator.Persistent. |
Temp | Corresponds to Allocator.Temp. |
TempJob | Corresponds to Allocator.TempJob. |
kErrorBufferOverflow | Memory allocation Buffer Overflow status |
kErrorNone | Memory allocation Success status |
Methods
Name | Description |
---|---|
Allocate(AllocatorHandle, int, int, int) | Allocates memory from an allocator. |
Allocate<T>(AllocatorHandle, int) | Allocates enough memory for an unmanaged value of a given type. |
Allocate<T>(ref T, int, int, int) | Allocates memory directly from an allocator. |
ConvertToAllocatorHandle(Allocator) | Convert an Allocator to an AllocatorHandle, keeping the Version. |
Free(AllocatorHandle, void*) | Frees an allocation. |
Free(AllocatorHandle, void*, int, int, int) | Frees an allocation. |
Free<T>(AllocatorHandle, T*, int) | Frees an allocation. |
Register<T>(ref T, bool, bool, int) | Saves an allocator's function pointers in a free slot of the global function table. Thread safe. |
Try(ref Block) | Invokes the allocator function of a block. |
UnmanagedUnregister<T>(ref T) | Removes an allocator's function pointers from the global function table, without managed code |
Unregister<T>(ref T) | Removes an allocator's function pointers from the global function table. |