Class CollectionHelper
Inheritance
System.Object
CollectionHelper
Syntax
public static class CollectionHelper
Methods
Align(Int32, Int32)
Declaration
public static int Align(int size, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
System.Int32 |
size |
|
System.Int32 |
alignmentPowerOfTwo |
|
Returns
Type |
Description |
System.Int32 |
|
CeilPow2(Int32)
Returns the smallest power of two that is greater than or equal to the given integer
Declaration
public static int CeilPow2(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int32 |
|
CheckIntPositivePowerOfTwo(Int32)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIntPositivePowerOfTwo(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
CheckIsUnmanaged<T>()
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIsUnmanaged<T>()
Type Parameters
Hash(Void*, Int32)
Returns hash value of memory block. Function is using djb2 (non-cryptographic hash).
Declaration
public static uint Hash(void *pointer, int bytes)
Parameters
Type |
Name |
Description |
System.Void* |
pointer |
|
System.Int32 |
bytes |
|
Returns
Type |
Description |
System.UInt32 |
|
IsPowerOfTwo(Int32)
Declaration
public static bool IsPowerOfTwo(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Log2Ceil(Int32)
Declaration
public static int Log2Ceil(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Type |
Description |
System.Int32 |
|
Log2Floor(Int32)
Declaration
public static int Log2Floor(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Type |
Description |
System.Int32 |
|
lzcnt(UInt32)
Declaration
public static int lzcnt(uint x)
Parameters
Type |
Name |
Description |
System.UInt32 |
x |
|
Returns
Type |
Description |
System.Int32 |
|