Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Neither ARC nor GC hide memory allocations. They automate the process of deallocating memory. And ARC does not hide that either. Values get released when they go out of scope, and they get deallocated when the last reference disappears. It's a very explicit process, the only "hiding" is the fact that there is no `[foo release]` line anymore. But it's no more hidden than C++ destructors are.

> Ref counting does pause, you get cascading deallocations.

That's not pausing. That's it doing work, upon request (i.e. when the object is released). If you have a single object that roots a massive object graph, and you release that single object, yes, it will have to destruct that entire object graph. But that's not the fault of ARC in the slightest, and would happen just the same with manual memory management.

> More deterministic than other GC though.

It's not GC, so what do you mean by "other GC"?

---

ARC has the exact same performance characteristics as manual memory management, except it's all automated so you can't screw it up (e.g. over-releasing or under-retaining). But it's subject to optimizations too (such as skipping the autorelease pool), which actually makes it faster than MRR in a lot of cases.



Top 5 Google hits for reference counting agree with me and say rc is a form of GC.

GC pauses are because of work in other forms of GC too.

As for explicitness... no. that's not explicit in my book.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: