site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On 03 Nov 2006, at 23:35, Uli Kusterer wrote: Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Am 03.11.2006 um 21:36 schrieb Jonas Maebe: You found the wrong docs, it's 16 byte aligned. See http://developer.apple.com/documentation/DeveloperTools/ Conceptual/LowLevelABI/Articles/IA32.html It also contains all information regarding how parameters are passed and how function results are returned. Thanks! I thought I'd read about 16-bit alignment being required when the G4 came out, All PPC ABI's used by Apple have always required a 16 byte aligned stack afaik, there's nothing G4-specific about that. and later hearing Intel was the same, but Intel's docs said differently. Well, the Intel cpus don't require a 16 byte aligned stack, but several MMX/SSE instructions do require a 16 byte aligned addresses and having the stack aligned at 16 bytes makes it easier to guarantee that. that would be 8. Instead it's 40. Without the corresponding C code, it's hard to say why exactly the compiler is doing that. The code is ridiculously simple: As Eric mentioned, if you turn on optimizations the stack frame disappears. Without optimization, the 40 probably comes from * 8 to align the stack pointer to a multiple of 16 (it was at 8 because of the return address of the caller and the "push %ebp") * 4 for the local variable, rounded up to a multiple of 16 * 8 for the parameters to the subroutine, rounded up to a multiple of 16. This email sent to site_archiver@lists.apple.com