# UnsafeList

> Initializes and returns an instance of UnsafeList.

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## UnsafeList(\`0\*, int)

Initializes and returns an instance of UnsafeList.

```csharp
public UnsafeList(T* ptr, int length)
```

### Parameters

**** (\[\<T>\*]\(./)): An existing byte array to set as the internal buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The length.

## UnsafeList(int, AllocatorHandle, NativeArrayOptions)

Initializes and returns an instance of UnsafeList.

```csharp
public UnsafeList(int initialCapacity, AllocatorManager.AllocatorHandle allocator, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The initial capacity of the list.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.**** (\[NativeArrayOptions]\(/engine/6000.7/script-reference/unity/collections/nativearrayoptions)): Whether newly allocated bytes should be zeroed out.
