CARB_ALIGN

Defined in carb/Defines.h

CARB_ALIGN(x, alignment)

Aligns a number or pointer to the next multiple of a provided alignment.

Note

The alignment need not be a power-of-two.

Parameters
  • x – The pointer or value to align

  • alignment – The alignment value in bytes.

Returns

If x is already aligned to alignment, returns x; otherwise returns x rounded up to the next multiple of alignment.