Open mihkhub opened 6 years ago
aligned (alignment)
This attribute specifies a minimum alignment (in bytes) for variables of the specified type. For example, the declarations:
struct S { short f[3]; } __attribute__ ((aligned (8)));
typedef int more_aligned_int __attribute__ ((aligned (8)));
force the compiler to ensure (as far as it can) that each variable whose type is struct S or more_aligned_int is allocated and aligned at least on a 8-byte boundary.
packed
This attribute, attached to struct
or union
type definition, specifies that each
member (other than zero-width bit-fields) of the structure or union is placed
to minimize the memory required. When attached to an enum definition, it
indicates that the smallest integral type should be used.
The keyword
__attribute__
allows you to specify special attributes of struct and union types when you define such types.