# TryAllocateBlock<T>(out Block, int)

> Allocates a block from this allocator.

## Definition

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

## TryAllocateBlock\<T>(Block, int)

```csharp
public int TryAllocateBlock<T>(out AllocatorManager.Block block, int items) where T : unmanaged
```

### Parameters

**** (\[Block]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/block)): Outputs the allocated block.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of values to allocate for.

### Returns

| Type                                                       | Description                                                                     |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | 0 if successful. Otherwise, returns the error code from the allocator function. |
