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.
systems
How software meets hardware — memory, the CPU, and the operating system layers between your code and the silicon.
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.