Method AllocateNativeArray
AllocateNativeArray<T>(int)
Allocate a NativeArray of type T from memory that is guaranteed to remain valid until the end of the next Update of this World. 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 after the end of the next Update for this World.
Declaration
public NativeArray<T> AllocateNativeArray<T>(int length) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | length | The length of the NativeArray to allocate, measured in elements. |
Returns
Type | Description |
---|---|
NativeArray<T> | The NativeArray allocated by this function. |
Type Parameters
Name | Description |
---|---|
T | The element type of the NativeArray to allocate. |