# AllocatorManager

> Manages custom memory allocators.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public static class AllocatorManager
```

## Static Fields

| Value                                                                                                                  | Description                                                             |
| ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [AudioKernel](/engine/6000.7/script-reference/unity/collections/allocatormanager/audiokernel.md)                       | Corresponds to Allocator.AudioKernel.                                   |
| [FirstUserIndex](/engine/6000.7/script-reference/unity/collections/allocatormanager/firstuserindex.md)                 | Index in the global function table of the first user-defined allocator. |
| [Invalid](/engine/6000.7/script-reference/unity/collections/allocatormanager/invalid.md)                               | Corresponds to Allocator.Invalid.                                       |
| [kErrorBufferOverflow](/engine/6000.7/script-reference/unity/collections/allocatormanager/kerrorbufferoverflow.md)     | Memory allocation Buffer Overflow status                                |
| [kErrorNone](/engine/6000.7/script-reference/unity/collections/allocatormanager/kerrornone.md)                         | Memory allocation Success status                                        |
| [MaxNumCustomAllocators](/engine/6000.7/script-reference/unity/collections/allocatormanager/maxnumcustomallocators.md) | Maximum number of user-defined allocators.                              |
| [None](/engine/6000.7/script-reference/unity/collections/allocatormanager/none.md)                                     | Corresponds to Allocator.None.                                          |
| [Persistent](/engine/6000.7/script-reference/unity/collections/allocatormanager/persistent.md)                         | Corresponds to Allocator.Persistent.                                    |
| [Temp](/engine/6000.7/script-reference/unity/collections/allocatormanager/temp.md)                                     | Corresponds to Allocator.Temp.                                          |
| [TempJob](/engine/6000.7/script-reference/unity/collections/allocatormanager/tempjob.md)                               | Corresponds to Allocator.TempJob.                                       |

## Static Methods

| Method                                                                                                                     | Description                                                                                      |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [Allocate](/engine/6000.7/script-reference/unity/collections/allocatormanager/allocate.md)                                 | Allocates memory from an allocator.                                                              |
| [ConvertToAllocatorHandle](/engine/6000.7/script-reference/unity/collections/allocatormanager/converttoallocatorhandle.md) | Convert an Allocator to an AllocatorHandle, keeping the Version.                                 |
| [Free](/engine/6000.7/script-reference/unity/collections/allocatormanager/free.md)                                         | Frees an allocation.                                                                             |
| [Initialize](/engine/6000.7/script-reference/unity/collections/allocatormanager/initialize.md)                             | For internal use only.                                                                           |
| [Register](/engine/6000.7/script-reference/unity/collections/allocatormanager/register.md)                                 | Saves an allocator's function pointers in a free slot of the global function table. Thread safe. |
| [Shutdown](/engine/6000.7/script-reference/unity/collections/allocatormanager/shutdown.md)                                 | For internal use only.                                                                           |
| [Try](/engine/6000.7/script-reference/unity/collections/allocatormanager/try.md)                                           | Invokes the allocator function of a block.                                                       |
| [UnmanagedUnregister](/engine/6000.7/script-reference/unity/collections/allocatormanager/unmanagedunregister.md)           | Removes an allocator's function pointers from the global function table, without managed code    |
| [Unregister](/engine/6000.7/script-reference/unity/collections/allocatormanager/unregister.md)                             | Removes an allocator's function pointers from the global function table.                         |

## Structs

| Struct                                                                                                                    | Description                                                 |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [AllocatorManager.AllocatorHandle](/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle.md) | Represents the allocator function used within an allocator. |
| [AllocatorManager.Block](/engine/6000.7/script-reference/unity/collections/allocatormanager/block.md)                     | Represents an individual allocation within an allocator.    |
| [AllocatorManager.BlockHandle](/engine/6000.7/script-reference/unity/collections/allocatormanager/blockhandle.md)         | For internal use only.                                      |
| [AllocatorManager.Range](/engine/6000.7/script-reference/unity/collections/allocatormanager/range.md)                     | A range of allocated memory.                                |

## Interfaces

| Interface                                                                                                       | Description                    |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [AllocatorManager.IAllocator](/engine/6000.7/script-reference/unity/collections/allocatormanager/iallocator.md) | An allocator function pointer. |

## Delegates

| Delegate                                                                                                          | Description                             |
| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| [AllocatorManager.TryFunction](/engine/6000.7/script-reference/unity/collections/allocatormanager/tryfunction.md) | Used for calling an allocator function. |
