Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetUnsafePtr<T>(NativeArray<T>)

Gets the pointer to the memory buffer owner of a NativeArray, and checks whether there is write access to the NativeArray. If there is no write access to the NativeArray, an InvalidOperationException is thrown.
Read time 1 minuteLast updated 11 days ago

Definition

public static void* GetUnsafePtr<T>(this NativeArray<T> nativeArray) where T : struct

Parameters

nativeArray

The NativeArray to check.

Returns

Type

Description

void*The memory buffer pointer of the NativeArray.