docs.unity3d.com
    Show / Hide Table of Contents

    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
    AllocatorManager.IAllocator.Function

    Handle

    Declaration
    public AllocatorManager.AllocatorHandle Handle { get; set; }
    Property Value
    Type Description
    AllocatorManager.AllocatorHandle
    Implements
    AllocatorManager.IAllocator.Handle

    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
    AllocatorManager.IAllocator.Try(ref AllocatorManager.Block)

    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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023