- Inside Macintosh: Mac OS Runtime Architectures /
- Chapter 5 - CFM-68K Runtime Conventions / Routine Calling Conventions
Stack Alignment
To improve performance, the CFM-68K runtime architecture requires a 4-byte (minimum) alignment for all parameters pushed onto the stack. This applies to stack space used in function prologs (that is, stack space reserved for automatic memory variables and temporaries) as well as space allocated using the alloca dynamic stack allocation operation. Types UInt8, SInt8, Boolean, UInt16, and SInt16 parameters are passed in the least significant byte or bytes with padding added. Data types struct, union, and extended are passed in the most significant bytes, with padding added afterwards if necessary.
© Apple Computer, Inc.
11 MARCH 1997