docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ScratchpadAllocator

    A fast allocator which allocates memory from its scratchpad.

    Implements
    AllocatorManager.IAllocator
    Namespace: Unity.Entities
    Assembly: Unity.Entities.dll
    Syntax
    [BurstCompile]
    public struct ScratchpadAllocator : AllocatorManager.IAllocator

    Properties

    Name Description
    Function

    All allocators must implement this property, in order to be installed in the custom allocator table.

    Handle

    Retrieve the AllocatorHandle associated with this allocator. The handle is used as an index into a global table, for times when a reference to the allocator object isn't available.

    IsAutoDispose

    Check whether this allocator will automatically dispose allocations.

    IsCustomAllocator

    Check whether this allocator is a custom allocator.

    ToAllocator

    Retrieve the Allocator associated with this allocator handle.

    Methods

    Name Description
    AllocateNativeArray<T>(int)

    Allocate a NativeArray of type T from memory that's guaranteed to remain valid until Rewind() is called on the Scratchpad.

    AllocateNativeList<T>(int)

    Allocate a NativeList of type T from memory that's guaranteed to remain valid until Rewind() is called on the Scratchpad.

    Dispose()

    Dispose the allocator.

    GetAvailableBytes()

    Get remaining bytes that are available to allocate.

    Initialize(int)

    Initializes the allocator. Must be called before first use.

    Rewind()

    Rewind the allocator; invalidate all allocations made from it.

    Try(ref Block)

    Try to allocate, free, or reallocate a block of memory.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)