Class NativeListUnsafeUtility | Collections | 0.12.0-preview.13
docs.unity3d.com
    Show / Hide Table of Contents

    Class NativeListUnsafeUtility

    Utilities for unsafe access to a NativeList<T>.

    Inheritance
    Object
    NativeListUnsafeUtility
    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    public static class NativeListUnsafeUtility

    Methods

    GetInternalListDataPtrUnchecked<T>(ref NativeList<T>)

    Gets a pointer to the internal list data (without checking for safe access).

    Declaration
    public static void *GetInternalListDataPtrUnchecked<T>(ref NativeList<T> list)
        where T : struct
    Parameters
    Type Name Description
    NativeList<T> list

    The NativeList.

    Returns
    Type Description
    Void*

    A pointer to the list data.

    Type Parameters
    Name Description
    T

    The type of list element.

    GetUnsafePtr<T>(NativeList<T>)

    Gets a pointer to the memory buffer containing the list items.

    Declaration
    public static void *GetUnsafePtr<T>(this NativeList<T> list)
        where T : struct
    Parameters
    Type Name Description
    NativeList<T> list

    The NativeList containing the buffer.

    Returns
    Type Description
    Void*

    A pointer to the memory buffer.

    Type Parameters
    Name Description
    T

    The type of list element.

    GetUnsafeReadOnlyPtr<T>(NativeList<T>)

    Gets a pointer to the memory buffer containing the list items.

    Declaration
    public static void *GetUnsafeReadOnlyPtr<T>(this NativeList<T> list)
        where T : struct
    Parameters
    Type Name Description
    NativeList<T> list

    The NativeList containing the buffer.

    Returns
    Type Description
    Void*

    A pointer to the memory buffer.

    Type Parameters
    Name Description
    T

    The type of list element.

    Remarks

    Thread safety mechanism is informed that this pointer will be used for read-only operations.

    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