Class CollectionHelper
Inheritance
CollectionHelper
Syntax
public static class CollectionHelper
Fields
CacheLineSize
Declaration
public const int CacheLineSize = default(int)
Field Value
Methods
Align(Int32, Int32)
Declaration
public static int Align(int size, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
Int32 |
size |
|
Int32 |
alignmentPowerOfTwo |
|
Returns
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 |
Int32 |
i |
|
Returns
CheckIntPositivePowerOfTwo(Int32)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIntPositivePowerOfTwo(int value)
Parameters
Type |
Name |
Description |
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 |
Void* |
pointer |
|
Int32 |
bytes |
|
Returns
IsAligned(UInt64, Int32)
Declaration
public static bool IsAligned(ulong offset, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
UInt64 |
offset |
|
Int32 |
alignmentPowerOfTwo |
|
Returns
IsAligned(Void*, Int32)
Declaration
public static bool IsAligned(void *p, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
Void* |
p |
|
Int32 |
alignmentPowerOfTwo |
|
Returns
IsPowerOfTwo(Int32)
Declaration
public static bool IsPowerOfTwo(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
Log2Ceil(Int32)
Declaration
public static int Log2Ceil(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
Log2Floor(Int32)
Declaration
public static int Log2Floor(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
lzcnt(UInt32)
Declaration
public static int lzcnt(uint x)
Parameters
Type |
Name |
Description |
UInt32 |
x |
|
Returns