

Automatic Reference Counting in Depth: Part I - lexicalscope
https://sectionfive.net/blog/2015/04/01/arc-in-depth-part-i/

======
tinganho
I'm not sure if this is ARC? I think this is just Objective-C:s retain and
release fundamentals. ARC as I understood it — is an offline compile solution.
That outputs retain and release calls. What you seem to describe is the
runtime and not the compiler?

~~~
lexicalscope
Sort of - ARC's behavior will vary based on the architecture, and in some
cases how the emitted code behaves will vary based on other parameters, but
the code emitted will be consistent.

ARC is not really about when to call retain and release at the correct time
though - it's more about managing object lifetimes and the guarantees related,
it actually goes to a lot of trouble to avoid calling retain and release.

You are right though - this post focuses more on the fundamentals of how
retain/release is implemented, and made efficient, but since this is only
really used in ARC and not in manual reference counting, it's applicable to
understanding ARC.

The second half of this will include details around how ARC uses these
optimized retain implementations to actually perform the reference counting
operations, how it determines things to remove vs keep, etc.

