Struct AllocatorManager.AllocatorHandle
Which allocator a Block's Range allocates from.
Namespace: Unity.Collections
Syntax
public struct AllocatorHandle : AllocatorManager.IAllocator, IDisposable
Fields
Index
Index into a function table of allocation functions.
Declaration
public ushort Index
Field Value
Type | Description |
---|---|
UInt16 |
Version
Version of the allocator at time of creation.
Declaration
public ushort Version
Field Value
Type | Description |
---|---|
UInt16 |
Properties
Function
Declaration
public AllocatorManager.TryFunction Function { get; }
Property Value
Type | Description |
---|---|
AllocatorManager.TryFunction |
Implements
Handle
Declaration
public AllocatorManager.AllocatorHandle Handle { get; set; }
Property Value
Type | Description |
---|---|
AllocatorManager.AllocatorHandle |
Implements
Value
Return the index
Declaration
public int Value { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
AllocateBlock<T>(Int32)
Allocates a Block of memory from this allocator with requested number of items of a given type.
Declaration
public AllocatorManager.Block AllocateBlock<T>(int Items)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
Int32 | Items | Number of items to allocate. |
Returns
Type | Description |
---|---|
AllocatorManager.Block | A Block of memory. |
Type Parameters
Name | Description |
---|---|
T | Type of item to allocate. |
Dispose()
Declaration
public void Dispose()
Try(ref AllocatorManager.Block)
Declaration
public int Try(ref AllocatorManager.Block block)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.Block | block |
Returns
Type | Description |
---|---|
Int32 |
Implements
TryAllocateBlock<T>(out AllocatorManager.Block, Int32)
Allocates a Block of memory from this allocator with requested number of items of a given type.
Declaration
public int TryAllocateBlock<T>(out AllocatorManager.Block block, int Items)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.Block | block | Block of memory to allocate within. |
Int32 | Items | Number of items to allocate. |
Returns
Type | Description |
---|---|
Int32 | Error code from the given Block's allocate function. |
Type Parameters
Name | Description |
---|---|
T | Type of item to allocate. |
Operators
Implicit(Allocator to AllocatorManager.AllocatorHandle)
Allows implicit conversion from allocator to allocator handle.
Declaration
public static implicit operator AllocatorManager.AllocatorHandle(Allocator a)
Parameters
Type | Name | Description |
---|---|---|
Allocator | a | Allocator to convert |
Returns
Type | Description |
---|---|
AllocatorManager.AllocatorHandle | A handle to the allocator |