3 ms·
Do we really need garbage collected languages when technology like Objective-C's ARC transparently "automates" the use of manual memory management? See: http:/
by wsc981 15y ago
Do we really need garbage collected languages when technology like Objective-C's ARC transparently "automates" the use of manual memory management?
See: http://clang.llvm.org/docs/AutomaticReferenceCounting.html http://clang.llvm.org/docs/AutomaticReferenceCounting.html
- ryanpetrich 15y agoARC is pretty slow in the presence of multiple CPUs as it's still reference counting underneath the hood (which requires atomic increment/decrement). Garbage collection and other forms of manual memory management have the potential to do much better.
- kmontrose 15y agoARC also requires you explicitly break cycles, and has additional "thinking overhead" (strong/weak on properties, no pointers in structs, and some void* magic iirc. It's certainly better than pure manual memory management, but it's not as painless (in terms of freeing a programmer from thinking about memory allocation) as a proper GC.
- soc88 15y agoYes. Just because it comes from Apple doesn't mean it has magic dust in it which makes broken stuff work. There is a reason no one is doing it except Apple. Apple choose ARC over GC because they never managed to get their GC to work reasonably well, not because ARC is better.
- mikeash 15y agoARC is a great alternative to memory management, but a poor alternative to garbage collection. It's still far too easy to leak objects by creating cycles under ARC.