Why boolean is 4 bytes instead of 1 byte in struct

The Bool is 1 byte, but there are 3 bytes of padding. Julia (and most other languages) pad structs to prevent memory alignment issues.

7 Likes