# Try(ref Block)

> Invoke the allocator function.

## Definition

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

## Try(Block)

```csharp
int Try(ref AllocatorManager.Block block)
```

### Parameters

**** (\[Block]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/block)): The block to allocate, deallocate, or reallocate. See [AllocatorManager.Try](/engine/6000.7/script-reference/unity/collections/allocatormanager/try.md)

### Returns

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