Class AllocatorManager
Namespace: Unity.Collections
Syntax
public static class AllocatorManager
Fields
AudioKernel
Corresponds to Allocator.AudioKernel.
Declaration
public static readonly AllocatorManager.AllocatorHandle AudioKernel
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
FirstUserIndex
User-defined allocator index.
Declaration
public const ushort FirstUserIndex = 32
Field Value
| Type | Description |
|---|---|
| UInt16 |
Invalid
Corresponds to Allocator.Invalid.
Declaration
public static readonly AllocatorManager.AllocatorHandle Invalid
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
None
Corresponds to Allocator.None.
Declaration
public static readonly AllocatorManager.AllocatorHandle None
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
Persistent
Corresponds to Allocator.Persistent.
Declaration
public static readonly AllocatorManager.AllocatorHandle Persistent
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
Temp
Corresponds to Allocator.Temp.
Declaration
public static readonly AllocatorManager.AllocatorHandle Temp
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
TempJob
Corresponds to Allocator.TempJob.
Declaration
public static readonly AllocatorManager.AllocatorHandle TempJob
Field Value
| Type | Description |
|---|---|
| AllocatorManager.AllocatorHandle |
Methods
Initialize()
Initializes SharedStatic allocator function table and allocator table, and installs default allocators.
Declaration
public static void Initialize()
Install(AllocatorManager.AllocatorHandle, IntPtr, AllocatorManager.TryFunction)
Creates and saves allocators' function pointers into function table.
Declaration
public static void Install(AllocatorManager.AllocatorHandle handle, IntPtr allocatorState, AllocatorManager.TryFunction function)
Parameters
| Type | Name | Description |
|---|---|---|
| AllocatorManager.AllocatorHandle | handle | AllocatorHandle to allocator to install function for. |
| IntPtr | allocatorState | IntPtr to allocator's custom state. |
| AllocatorManager.TryFunction | function | Function pointer to create or save in function table. |
Shutdown()
Declaration
public static void Shutdown()
Try(ref AllocatorManager.Block)
Looks up an allocator's allocate, free, or realloc function pointer from a table and invokes the function.
Declaration
public static int Try(ref AllocatorManager.Block block)
Parameters
| Type | Name | Description |
|---|---|---|
| AllocatorManager.Block | block | Block to allocate memory for. |
Returns
| Type | Description |
|---|---|
| Int32 | Error code of invoked function. |