Skip to content

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)

Usage examples (Cross-references)
        }
    
        return v->alignment > 1 ? ALIGN_UP_POW2(item_size, v->alignment) : item_size;
    }
Last updated on