79739165

Date: 2025-08-18 19:35:56
Score: 1
Natty:
Report link

Alignment depends on the CPU and ABI (Application Binary Interface). On most 64-bit CPU's a double is 8-byte aligned. Misaligned accesses may still work on modern x86 or ARM64, but the hardware has to do extra work and it can be slower. What you saw in your test is the CPU and cache hiding most of the penalty. If you want to know the exact rule on your system, check alignof(double) in C++ or look up the ABI docs, but the safe practice is to let the compiler align structs for you.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Vinay Kandula