ALIGN_UP_POW2

Table of Contents

ALIGN_UP_POW2

Description

Aligns the given value up to the nearest power-of-two multiple.

Parameters

NameDirectionDescription
valueinThe value to be aligned up.
alignmentinThe 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)

    }
    
    return v->alignment > 1 ? ALIGN_UP_POW2(item_size, v->alignment) : item_size;
    }

Share :

Related Posts

ALIGN_UP

ALIGN_UP Description Aligns the given value up to the nearest multiple of alignment.

Read More

LVAL

LVAL Description Creates a temporary, addressable l-value from a given expression x.

Read More

ALIGN_DOWN

ALIGN_DOWN Description Aligns the given value down to the nearest multiple of alignment.

Read More