[][src]Attribute Macro cuneiform::boundary_size

#[boundary_size]

Boundary size alignment for RAM data.

This macro allows fetching feasible local data size boundary alignment, and embeds it into your code as constant with the same name. When acquired it can be used to have single-shot aligned contiguous memory blocks.

Example

use cuneiform::*;

#[boundary_size]
type BS = ();

let layout = unsafe {
   Layout::from_size_align_unchecked(1 << 4, BOUNDARY_SIZE as usize)
};
assert_eq!(layout.align(), BOUNDARY_SIZE as usize);