# UnsafeRingQueue

> Initializes and returns an instance of UnsafeRingQueue which aliasing an existing buffer.

## Definition

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

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

Initializes and returns an instance of UnsafeRingQueue which aliasing an existing buffer.

```csharp
public UnsafeRingQueue(T* ptr, int capacity)
```

### Parameters

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

## UnsafeRingQueue(int, AllocatorHandle, NativeArrayOptions)

Initializes and returns an instance of UnsafeRingQueue.

```csharp
public UnsafeRingQueue(int capacity, AllocatorManager.AllocatorHandle allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The capacity.**** (\[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.
