Design is in the Code

by José Carlos Joaquim

Automatic Reference Counting

tagged in: iOS, Objective-C, LLVM

One of the many things iOS 5 introduces is Automatic Reference Counting (ARC) that takes away most of the memory management pains and let’s the compiler deal with them.

In Apple’s iOS 5 for Developers it goes like:

Automatic Reference Counting
Automatic Reference Counting (ARC) for Objective-C makes memory management the job of the compiler. By enabling ARC with the new Apple LLVM compiler, you will never need to type retain or release again, dramatically simplifying the development process, while reducing crashes and memory leaks. The compiler has a complete understanding of your objects, and releases each object the instant it is no longer used, so apps run as fast as ever, with predictable, smooth performance.

If you want to get to know this new approach to Objective-C’s memory management one good starting point would be, if you have a Developer account, the Apple Developer docs and the WWDC Session Videos.

You can find a complete technical specification of Automatic Reference Counting in clang llvm’s docs at Automatic Reference Counting. The videos might be more to the point but this stands a must-read in order to underpin this new approach.

blog comments powered by Disqus

About me

Hello, my name is José Carlos Joaquim and I'm a iOS and Ruby developer working in Paris. I'm passionate about my wife and kids, technology and I really appreciate cheese.

more about me…