Saturday, June 28, 2014

Compiler Writers Gone Wild: ARC Madness

Marcel Weiher:

When they turned to me, I was also initially puzzled, because all this should do on x86 is stuff a zero into %eax and return. This cannot possibly crash, so everyone just assumed that the stack traces were off, as they frequently are.


Fortunately I had just looked at the project settings and noticed that we were compiling with -O0, so optimizations disabled, and my suspicion was that ARC was doing some unnecessary retaining. That suspicion turned out to be on the money, otool -Vt revealed that ARC had turned our innocuous return NO; into the following monstrosity.

I think you pretty much have to use the optimizer when using ARC. Otherwise, in normal use the code is really slow, and when debugging it’s so different from the normal code that you will be checking different things.

Comments RSS · Twitter

Leave a Comment