# AllocatorManager.Block

> Represents an individual allocation within an 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 AllocatorManager.Block : IDisposable
```

## Remarks

A block consists of a [AllocatorManager.Block.Range](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/range.md) plus metadata about the type of elements for which the block was allocated.

## Fields

| Value                                                                                                        | Description                                                  |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| [AllocatedItems](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/allocateditems.md) | Number of items allocated for.                               |
| [BytesPerItem](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/bytesperitem.md)     | Number of bytes per item.                                    |
| [Log2Alignment](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/log2alignment.md)   | Log2 of the byte alignment.                                  |
| [Padding0](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/padding0.md)             | This field only exists to pad the `Block` struct. Ignore it. |
| [Padding1](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/padding1.md)             | This field only exists to pad the `Block` struct. Ignore it. |
| [Padding2](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/padding2.md)             | This field only exists to pad the `Block` struct. Ignore it. |
| [Range](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/range.md)                   | The range of memory encompassed by this block.               |

## Properties

| Property                                                                                                     | Description                               |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| [Alignment](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/alignment.md)           | The alignment.                            |
| [AllocatedBytes](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/allocatedbytes.md) | Number of bytes allocated for this block. |
| [Bytes](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/bytes.md)                   | Number of bytes requested for this block. |

## Methods

| Method                                                                                                 | Description                      |
| ------------------------------------------------------------------------------------------------------ | -------------------------------- |
| [Allocate](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/allocate.md)       | Allocates this block.            |
| [Dispose](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/dispose.md)         | Deallocates this block.          |
| [Free](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/free.md)               | Frees the block.                 |
| [TryAllocate](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/tryallocate.md) | Attempts to allocate this block. |
| [TryFree](/engine/6000.7/script-reference/unity/collections/allocatormanager/block/tryfree.md)         | Attempts to free this block.     |
