{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method Free | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Free

    Free(AllocatorHandle, void*, int, int, int)

    Frees an allocation.

    Declaration
    public static void Free(AllocatorManager.AllocatorHandle handle, void* pointer, int itemSizeInBytes, int alignmentInBytes, int items = 1)
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle handle

    A handle to the allocator.

    void* pointer

    A pointer to the allocated memory.

    int itemSizeInBytes

    The size in bytes of the allocation.

    int alignmentInBytes

    The alignment in bytes (must be a power of two).

    int items

    The number of values that the memory was allocated for.

    Remarks

    For some allocators, the size of the allocation must be known to properly deallocate. Other allocators only need the pointer when deallocating and so will ignore itemSizeInBytes, alignmentInBytes and items.

    Free(AllocatorHandle, void*)

    Frees an allocation.

    Declaration
    public static void Free(AllocatorManager.AllocatorHandle handle, void* pointer)
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle handle

    A handle to the allocator.

    void* pointer

    A pointer to the allocated memory.

    Free<T>(AllocatorHandle, T*, int)

    Frees an allocation.

    Declaration
    public static void Free<T>(AllocatorManager.AllocatorHandle handle, T* pointer, int items = 1) where T : unmanaged
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle handle

    A handle to the allocator.

    T* pointer

    A pointer to the allocated memory.

    int items

    The number of values that the memory was allocated for.

    Type Parameters
    Name Description
    T

    The type of value that the memory was allocated for.

    Remarks

    For some allocators, the size of the allocation must be known to properly deallocate. Other allocators only need the pointer when deallocating and so will ignore T and items.

    In This Article
    Back to top
    Copyright © 2023 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)