docs.unity3d.com
    Show / Hide Table of Contents

    Struct ScratchpadAllocator

    Namespace: Unity.Entities
    Syntax
    [BurstCompile]
    [BurstCompatible]
    public struct ScratchpadAllocator : AllocatorManager.IAllocator, IDisposable

    Constructors

    Name Description
    ScratchpadAllocator(Scratchpad)

    Properties

    Name Description
    Function
    Handle
    IsCustomAllocator
    ToAllocator

    Methods

    Name Description
    AllocateNativeArray<T>(Int32)

    Allocate a NativeArray of type T from memory that is guaranteed to remain valid until the Scratchpad allocator is Rewound (under user control). There is no contention for this memory between threads. There is no need to Dispose the NativeArray so allocated. It is not possible to free the memory by Disposing it - it is automatically freed when the Scratchpad is Rewound.

    AllocateNativeList<T>(Int32)

    Allocate a NativeList of type T from memory that is guaranteed to remain valid until the Scratchpad allocator is Rewound (under user control). There is no contention for this memory between threads. There is no need to Dispose the NativeList so allocated. It is not possible to free the memory by Disposing it - it is automatically freed when the Scratchpad is Rewound.

    Dispose()
    Rewind()
    Try(ref AllocatorManager.Block)
    Back to top
    Terms of use
    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