3 ms·
> my assumption is that they specified `#[repr(packed(8))]` on some structs to use alignments and paddings of at most 8 bytes That would mean taking a referenc
by thayne 3y ago
> my assumption is that they specified `#[repr(packed(8))]` on some structs to use alignments and paddings of at most 8 bytes
That would mean taking a reference of any field of that struct is undefined behavior, unless the compiler does some special magic for this specific case.
> Using `[repr(align(8))]` on the field
I don't think you can do that directly. You would need to use a newtype that specified the alignment, and use that type for the field.