Alignment Macros
include/math/align.h View source View on GitHubMacros
Section titled “Macros”ALIGN_DOWN
Section titled “ALIGN_DOWN”#define ALIGN_DOWN(x, align) ((x) & ~((align) - 1ULL)) ALIGN_UP
Section titled “ALIGN_UP”#define ALIGN_UP(x, align) (((x) + ((align) - 1ULL)) & ~((align) - 1ULL)) IS_ALIGNED
Section titled “IS_ALIGNED”#define IS_ALIGNED(x, align) (((x) & ((align) - 1)) == 0)