BloombergLP::bsls::AlignmentUtil

This struct provides a namespace for a suite of compile-time constants, types, and pure procedures that provide platform-dependent alignment information.

Synopsis

Declared in <bsls_alignmentutil.h>

struct AlignmentUtil;

Type Aliases

NameDescription
MaxAlignedType Alias for a primitive type that has the most stringent alignment requirement.

Enums

NameDescription
Unnamed enum Maximum alignment supported on the current platform.

Static Member Functions

NameDescription
calculateAlignmentFromSize Return the natural alignment for a memory block of the specified size.
calculateAlignmentOffset Return the offset needed to align the specified address.
defaultAlignmentOfAlignedStorage Return the default std::aligned_storage alignment for t_SIZE.
is2ByteAligned Return true if the specified address is aligned on a 2-byte boundary (i.e., the numerical value of address is evenly divisible by 2), and false otherwise.
is4ByteAligned Return whether the specified address is aligned on a 4-byte boundary.
is8ByteAligned Return true if the specified address is aligned on an 8-byte boundary (i.e., the numerical value of address is evenly divisible by 8), and false otherwise.
isAligned Return whether the specified address is aligned to the given boundary.
pointerAlignment Return the alignment of the specified address. Returns 0 if address is 0. Note that the returned value might be larger than BSLS_MAX_ALIGNMENT.
roundUpToMaximalAlignment Return the specified size rounded up to the maximum alignment.

Friends

NameDescription
BloombergLP::bsls::AlignmentUtil::MaxAlignedUnion