Interface __ALIGN_ATTR__

Preprocessor macro expanding to a type attribute

#include <SYS/TYPES.H>

type variable __ALIGN_ATTR__(a);

Description

This macro advises the compiler to align a given variable or structure element on a given boundary.

Because the code may be compiled with compiler not supporting this attribute, code correctness must not depend on alignment — it may be only used for optimizations such as preventing variables from crossing cache line boundary.

If the alignment is required for code correctness, use memalign or allocate larger array, cast array address to unsigned long and align it with arithmetic operators.

Arguments

Implementation note

When using the gcc compiler, this macro expands to __attribute__((__aligned__(a))).