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

Manual management involves an explicit function call. Functions called by a destructor are considered automatic.


How does this relate?


What exactly don't you understand?


how this relates to garbage collectors


Because that is precisely the trade-off we're discussing.

With immediate reference-counted reclamation, dropping the last reference can put an arbitrarily large amount of destruction and deallocation work on the current thread. If you defer that reclamation to get it off the critical path, you have introduced a collector that reclaims unreachable objects later.

Whether that collector discovers garbage by tracing or receives zero-reference objects from reference counting is an implementation detail. In both cases, memory reclamation is automatic and deferred.

So the supposed distinction "with ARC I know when I pay the reclamation cost, with GC I don't" only holds if you're willing to pay an unbounded reclamation cost synchronously when the last reference is dropped.


> Whether that collector discovers garbage by tracing or receives zero-reference objects from reference counting is an implementation detail

No, it is not. The latter is deterministic, predictable and controllable.

> only holds if you're willing to pay an unbounded reclamation cost synchronously when the last reference is dropped.

No, just because moving an arc/deallocation between threads doesn't change anything about the deallocation.

Aside that, contrary to GCs it's not unbounded,but bounded by the deallocation cost of the given arc.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: