3 ms·
ARC is a tradeoff between manual and automatic memory management. Requring a little bit more care from programmer is intentional, not a disadvantage as you pict
by hamstergene 10y ago
ARC is a tradeoff between manual and automatic memory management. Requring a little bit more care from programmer is intentional, not a disadvantage as you picture it, it is a price for not having, you know, GC. GC is less error prone not for free but at the price of eating CPU and memory, which in the world of mobile devices equal less battery life, so it is quite desirable for iPhones and MacBooks software not to have it.
- pjmlp 10y agoARC is automatic memory management. "The Garbage Collection Handbook", chapter 5 http://gchandbook.org/ http://gchandbook.org/
- devsquid 10y agoYup but people love to argue over the small shit. Chris Lattner even refers to ARC as a form of GC.
- hamstergene 10y agoDifferent approaches to memory management differ in extent of how much of programmer's job they automate. Garbage collectors are fully automatic and rarely if ever require to mind anything; automatic RC does almost everything but requires programmer to analyze and annotate some things as 'weak'; manual RC requires a lot more programmer's effort while still technically being "automatic"; and manual memory management means the programmer does everything. Automatic/manual is a scale, not a boolean yes/no, and the point is that ARC lies on it a bit closer to manual than garbage collectors.
- pjmlp 10y agoThe thing is, ARC is a garbage collection algorithm. There isn't anything like ARC vs GC, that is layman knowledge and just wrong from CS point of view.
- hamstergene 10y agoARC is not an algorithm, it a language-level feature that generates retain/release calls automatically so that the programmer does not have to. Unlike GC systems where the resulting program does run an algorithm (and wastes CPU on that), with ARC the generated program is no different as if retain/release were written manually and runs no extra code.