4 ms·
Is there a way to request that the compiler not do this on a per-structure basis?
by grok2 12y ago
Is there a way to request that the compiler not do this on a per-structure basis?
- dezgeg 12y agoThere's a #[repr(C)] annotation that can be placed on a struct, IIRC.
- FreeFull 12y agoThat guarantees the same layout that C would have for that struct. There is also #[repr(packed)] which puts things as close as possible without alignment, and then you can insert padding manually with fields of type [u8; N] where N is the number of bytes.
- deleted 12y ago[deleted]