zephyr

Module align

source
Expand description

Alignment

Natively, the align attribute in rust does not allow anything other than an integer literal. However, Zephyr will define the external alignment based on numeric constants. This defines a bit of a trick to enforce alignment of structs to values by defined constants.

Thanks to Chayim Refael Friedman for help with this.

Structsยง

  • Align a given struct to a given alignment. To use this, just include AlignAs<N> as the first member of the struct.