ALIGN_UP_POW2
- Macro
- August 22, 2025
Table of Contents
ALIGN_UP_POW2
ALIGN_UP_POW2
Description
Aligns the given value
up to the nearest power-of-two multiple.
Parameters
Name | Direction | Description |
---|---|---|
value | in | The value to be aligned up. |
alignment | in | The power-of-two alignment boundary. |
Success
Returns power-of-two aligned-up value when alignment > 1.
Failure
Function cannot fail - returns original value if alignment <= 1.
Usage example (Cross-references)
- In
Vec.c:27
:
}
return v->alignment > 1 ? ALIGN_UP_POW2(item_size, v->alignment) : item_size;
}