ARC's Fast Autorelease

| No Comments

I just read:

http://rentzsch.tumblr.com/post/75082194868/arcs-fast-autorelease

Many people have noted how ARC is clever in the way that it avoids hitting the autorelease pool in some cases. It is clever, but in the articles I’ve read, they miss the point a little bit because they don’t mention why it is done that way.

A naïve approach would be to simply always put the autoreleased object in thread local storage and then check in your retain method. It would be much simpler (no assembly) and it would optimise manual reference counting code too.

So why bother doing it the way they do? A long time ago, I posed this question on the Objective-C mailing list and here’s the answer I eventually got: http://lists.apple.com/archives/objc-language/2012/Jul/msg00076.html.

Leave a comment