Precise memory layout control in Rust?
As described in the FFI guide, you can add attributes to structs to use the same layout as C: #[repr(C)] struct Object { a: i32, // other members } and you also have the ability to pack the struct: #[repr(C, packed)] struct Object { a: i32, // other members } And for detecting that the … Read more