Method IsAligned
IsAligned(void*, int)
Returns true if the address represented by the pointer has a given alignment.
Declaration
public static bool IsAligned(void* p, int alignmentPowerOfTwo)
Parameters
Type | Name | Description |
---|---|---|
void* | p | The pointer. |
int | alignmentPowerOfTwo | A non-zero, positive power of two. |
Returns
Type | Description |
---|---|
bool | True if the address is a multiple of |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
IsAligned(ulong, int)
Returns true if an offset has a given alignment.
Declaration
public static bool IsAligned(ulong offset, int alignmentPowerOfTwo)
Parameters
Type | Name | Description |
---|---|---|
ulong | offset | An offset |
int | alignmentPowerOfTwo | A non-zero, positive power of two. |
Returns
Type | Description |
---|---|
bool | True if the offset is a multiple of |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |