# 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.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public NativeArray<T> AllocateNativeArray<T>(int length) where T : unmanaged
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The length of the NativeArray to allocate, measured in elements.

### Returns

| Type                                                                                 | Description                                 |
| ------------------------------------------------------------------------------------ | ------------------------------------------- |
| [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) | The NativeArray allocated by this function. |
