January 10, 2010
Today I found this out
(after spending much of the day banging my head against the wall)
#include <stdio.h>
struct test1 { double b; };
struct test2 { int a; test1 b; };
test2 foo;
int main()
{
printf("%d\n",(int)&foo.b.b - (int)&foo);
return 0;
}
What does this print? On Windows, it prints 8. On OS X (or linux), it prints 4. Which means, if you access foo.b.b a lot, it will be slow. UGH. I guess that's why there's -malign-double for gcc. Now if I can just figure out how to enable that for Xcode...
Recordings:
freeform jam with brennewtnoj