Class NativeListUnsafeUtility
Utilities for unsafe access to a NativeList<T>.
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.