Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

AllocatorManager.Try

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int Try(ref Block block);

Parameters

Parameter Description
block The block to allocate, deallocate, or reallocate.

Returns

int 0 if successful. Otherwise, returns the error code from the block's allocator function.

Description

Invokes the allocator function of a block.

The allocator function is looked up from a global table.

- If the block range's Pointer is null, it will allocate.
- If the block range's Pointer is not null, it will reallocate.
- If the block range's Items is 0, it will deallocate.