# AllocatorHelper<T>

> Provides a wrapper for custom allocator.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public struct AllocatorHelper<T> : IDisposable where T : unmanaged, AllocatorManager.IAllocator
```

## Constructors

| Constructor                                                                                                                                                                      | Description                                                          |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [AllocatorHelper\`1(Unity.Collections.AllocatorManager.AllocatorHandle,System.Boolean,System.Int32)](/engine/6000.7/script-reference/unity/collections/allocatorhelper1/ctor.md) | Allocate the custom allocator from backingAllocator and register it. |

## Properties

| Property                                                                                     | Description               |
| -------------------------------------------------------------------------------------------- | ------------------------- |
| [Allocator](/engine/6000.7/script-reference/unity/collections/allocatorhelper1/allocator.md) | Get the custom allocator. |

## Methods

| Method                                                                                   | Description                                                    |
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [Dispose](/engine/6000.7/script-reference/unity/collections/allocatorhelper1/dispose.md) | Dispose the custom allocator backing memory and unregister it. |
