# ToArray(AllocatorHandle)

> Returns an array containing a copy of this queue's content.

## Definition

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

```csharp
public NativeArray<T> ToArray(AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Returns

| Type                                                                                 | Description                                                                                                                                                                                |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) | An array containing a copy of this queue's content. The elements are ordered in the same order they were enqueued, "e.g." the earliest enqueued element is copied to index 0 of the array. |
