Align
Returns an allocation size in bytes that factors in alignment.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Align(int, int)
Returns an allocation size in bytes that factors in alignment.
public static int Align(int size, int alignmentPowerOfTwo)
Parameters
Returns
Type | Description |
|---|---|
| int | The smallest integer that is greater than or equal to |
Examples
// 55 aligned to 16 is 64.int size = CollectionHelper.Align(55, 16);
Align(long, int)
Returns an allocation size in bytes that factors in alignment.
public static long Align(long size, int alignmentPowerOfTwo)
Parameters
Returns
Type | Description |
|---|---|
| long | The smallest integer that is greater than or equal to |
Examples
// 55 aligned to 16 is 64.long size = CollectionHelper.Align(55, 16);
Align(ulong, ulong)
Returns an allocation size in bytes that factors in alignment.
public static ulong Align(ulong size, ulong alignmentPowerOfTwo)
Parameters
Returns
Type | Description |
|---|---|
| ulong | The smallest integer that is greater than or equal to |
Examples
// 55 aligned to 16 is 64.ulong size = CollectionHelper.Align(55, 16);