# UnsafeScratchAllocator

> A fixed-size buffer from which you can make allocations.

## Definition

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

```csharp
public struct UnsafeScratchAllocator
```

## Remarks

Allocations from a scratch allocator are not individually deallocated. Instead, when you're done using all the allocations from a scratch allocator, you dispose the allocator as a whole.

## Constructors

| Constructor                                                                                                                                            | Description                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| [UnsafeScratchAllocator(System.Void\*,System.Int32)](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafescratchallocator/ctor.md) | Initializes and returns an instance of UnsafeScratchAllocator. |

## Methods

| Method                                                                                                           | Description                                                 |
| ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [Allocate](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafescratchallocator/allocate.md) | Returns an allocation from the allocator's internal buffer. |
