Why does the Mac ABI require 16-byte stack alignment for x86-32?

前端 未结 10 2226
野趣味
野趣味 2020-11-27 16:01

I can understand this requirement for the old PPC RISC systems and even for x86-64, but for the old tried-and-true x86? In this case, the stack needs to be aligned on 4 byte

10条回答
  •  日久生厌
    2020-11-27 16:52

    My guess is that Apple believes everyone just uses XCode (gcc) which aligns the stack for you. So requiring the stack to be aligned so the kernel doesn't have to is just a micro-optimization.

提交回复
热议问题