ARC's Fast Autorelease

| No Comments

I just read:

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:

Leave a comment