# Scratchpad

> A scratch pad that contains multiple scratch pad allocators. User can can get a scratch pad allocator from the pad corresponding to its thread index. It automatically invalidates all allocations made from it, when "rewound" by the user.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
[BurstCompile]
public struct Scratchpad
```

## Constructors

| Constructor                                                                                                                            | Description          |
| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| [Scratchpad(System.Int32,System.Int32,System.Boolean,System.Int32)](/engine/7000.0/script-reference/unity/entities/scratchpad/ctor.md) | Create a Scratchpad. |

## Methods

| Method                                                                                                        | Description                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Dispose](/engine/7000.0/script-reference/unity/entities/scratchpad/dispose.md)                               | Dispose the Scratchpad. This must be called to unregister and free the ScratchpadAllocators this Scratchpad contains.                                                     |
| [GetScratchpadAllocator](/engine/7000.0/script-reference/unity/entities/scratchpad/getscratchpadallocator.md) | Retrieve the ScratchpadAllocator from the Scratchpad with index corresponding to the running thread index.                                                                |
| [Initialize](/engine/7000.0/script-reference/unity/entities/scratchpad/initialize.md)                         | Initialize a Scratchpad.                                                                                                                                                  |
| [Rewind](/engine/7000.0/script-reference/unity/entities/scratchpad/rewind.md)                                 | Rewind the Scratchpad; rewinds all ScratchpadAllocator invalidate all allocations made from it, and potentially also free memory blocks it has allocated from the system. |
