# UnsafeScratchAllocator(void*, int)

> Initializes and returns an instance of UnsafeScratchAllocator.

## Definition

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

```csharp
public UnsafeScratchAllocator(void* ptr, int capacityInBytes)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): An existing buffer to use as the allocator's internal buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size in bytes of the internal buffer.
