Interface AllocatorManager.IAllocator
An allocator function pointer.
Namespace: Unity.Collections
Syntax
public interface IAllocator : IDisposable
Properties
Function
The allocator function. It can allocate, deallocate, or reallocate.
Declaration
AllocatorManager.TryFunction Function { get; }
Property Value
Type | Description |
---|---|
AllocatorManager.TryFunction |
Handle
This allocator.
Declaration
AllocatorManager.AllocatorHandle Handle { get; set; }
Property Value
Type | Description |
---|---|
AllocatorManager.AllocatorHandle | This allocator. |
IsAutoDispose
Check whether an allocator will automatically dispose allocations.
Declaration
virtual bool IsAutoDispose { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Allocations made by allocator are not automatically disposed by default.
IsCustomAllocator
Check whether an allocator is a custom allocator
Declaration
bool IsCustomAllocator { get; }
Property Value
Type | Description |
---|---|
Boolean |
ToAllocator
Cast the Allocator index into Allocator
Declaration
Allocator ToAllocator { get; }
Property Value
Type | Description |
---|---|
Allocator |
Methods
Try(ref AllocatorManager.Block)
Invoke the allocator function.
Declaration
int Try(ref AllocatorManager.Block block)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.Block | block | The block to allocate, deallocate, or reallocate. See Try(ref AllocatorManager.Block) |
Returns
Type | Description |
---|---|
Int32 | 0 if successful. Otherwise, returns the error code from the allocator function. |