Class CollectionHelper
Inheritance
CollectionHelper
Syntax
public static class CollectionHelper
Fields
CacheLineSize
Declaration
public const int CacheLineSize = 64
Field Value
Methods
Align(Int32, Int32)
Declaration
public static int Align(int size, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
Int32 |
size |
|
Int32 |
alignmentPowerOfTwo |
|
Returns
CheckIntPositivePowerOfTwo(Int32)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIntPositivePowerOfTwo(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
CheckIsUnmanaged<T>()
Throws exeception if type T is managed.
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
[BurstDiscard]
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 *ptr, int bytes)
Parameters
Type |
Name |
Description |
Void* |
ptr |
A pointer to the buffer.
|
Int32 |
bytes |
Number of bytes to hash.
|
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