常见属性标记
强制内存对齐
#![allow(unused)]
fn main() {
#[repr(align(64))]
struct CachePadded(AtomicU64);
}
A data of alignment X is stored in memory at address multiple of X
https://doc.rust-lang.org/reference/attributes.html
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help