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

Block

struct in Unity.Collections

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

Description

Represents an individual allocation within an allocator.

A block consists of a AllocatorManager.Block.Range plus metadata about the type of elements for which the block was allocated.

Properties

Property Description
Alignment The alignment.
AllocatedBytes Number of bytes allocated for this block.
AllocatedItems Number of items allocated for.
Bytes Number of bytes requested for this block.
BytesPerItem Number of bytes per item.
Log2Alignment Log2 of the byte alignment.
Padding0 This field only exists to pad the Block struct. Ignore it.
Padding1 This field only exists to pad the Block struct. Ignore it.
Padding2 This field only exists to pad the Block struct. Ignore it.
Range The range of memory encompassed by this block.

Public Methods

Method Description
Allocate Allocates this block.
Dispose Deallocates this block.
Free Frees the block.
TryAllocate Attempts to allocate this block.
TryFree Attempts to free this block.