Memory alignment on a 32-bit Intel processor

后端 未结 5 1605
攒了一身酷
攒了一身酷 2020-12-01 10:06

Intel\'s 32-bit processors such as Pentium have 64-bit wide data bus and therefore fetch 8 bytes per access. Based on this, I\'m assuming that the physical addresses that th

5条回答
  •  隐瞒了意图╮
    2020-12-01 10:09

    They are justified in doing so because changing to 8-byte alignment would constitute an ABI change, and the marginal performance improvement is not worth the trouble.

    As someone else already said, cachelines matter. All accesses on the actual memory bus are in terms of cache lines (64 bytes on x86, IIRC). See the "What every programmer needs to know about memory" doc that was mentioned already. So the actual memory traffic is 64 byte aligned.

提交回复
热议问题