Class CollectionHelper
Inheritance
CollectionHelper
Syntax
public static class CollectionHelper : object
Fields
CacheLineSize
Declaration
public const int CacheLineSize = null
Field Value
Methods
Align(Int32, Int32)
Declaration
public static int Align(int size, int alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
Int32 |
size |
|
Int32 |
alignmentPowerOfTwo |
|
Returns
Align(UInt64, UInt64)
Declaration
public static ulong Align(ulong size, ulong alignmentPowerOfTwo)
Parameters
Type |
Name |
Description |
UInt64 |
size |
|
UInt64 |
alignmentPowerOfTwo |
|
Returns
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