# ToNativeArray(AllocatorHandle)

> Returns an array with a copy of this set's values (in no particular order).

## Definition

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

```csharp
public NativeArray<T> ToNativeArray(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 with a copy of the set's values. |
