systems
Why 1 + 4 + 1 Equals 12: Struct Padding in C vs Rust
The same three fields add up to 6 bytes on paper and 12 bytes inside a C struct. Why the CPU reads memory in fixed chunks, where C inserts padding, and how Rust reclaims the wasted space.
Tag
1 article tagged with "padding"
The same three fields add up to 6 bytes on paper and 12 bytes inside a C struct. Why the CPU reads memory in fixed chunks, where C inserts padding, and how Rust reclaims the wasted space.