Hacker News new | ask | show | jobs
by pjmlp 2077 days ago
> Will the GCs (since ARC isn't really a GC) be deprecated at that time?

Any form of reference counting is definitely a GC.

http://gchandbook.org/contents.html (chapter 5)

1 comments

I guess the more interesting questions is whether it happens at compile time or run-time - ARC definitely injects derefs at compile time and therefore there are no gc-"pauses" at runtime.

(Right?)

There are always pauses at runtime, when a reference reaching the count of zero starts a domino effect of references being decreased to zero.

Which is why in most high performance RC, you get a tracing GC in disguise, because the actual deletion is moved into a background cleaning thread.

An example of this in production is the C++/WinRT framework for COM/UWP.

In that regard it's not too dissimilar to Rust's semantics when memory is free'ed (https://news.ycombinator.com/item?id=23362518).

Nim's ARC does inject refs/decrs, but they're not atomic which means it's overhead can be pretty minimal. I don't know if ObjC/Swifts ARC uses atomics or locking. GTK's object system for example uses locking which makes it pretty expensive.

Ah, that's true.
if you want to collect cycles, you have to find them, and may cause pauses.