3 ms·
> Swift, had it not needed backwards compatibility with Objective-C, could probably have gone with a tracing collector. Programs using tracing GC have a higher
by frou_dh 2y ago
> Swift, had it not needed backwards compatibility with Objective-C, could probably have gone with a tracing collector.
Programs using tracing GC have a higher memory ceiling than the equivalent using RC, don't they? Because things hang around for a little (or a lot) longer than is strictly needed. Apple's M.O. has been to put as little RAM in the iPhone as they can get away with.
- sirwhinesalot 2y agoThat's also a good point, I remember hearing complaints about the Objective-C GC around the time relating to that.
- pjmlp 2y agoYes, on the other had, the optimizations to make RC impact run-time execution as little as possible, slowly turn them into a kind of tracing GC algorithm anyway. Specially when you add stuff like background cleanup threads to handle the domino effects of when a pointer reaches zero, and it is pointing to a graph structure full of pointers that will themselves reach zero. And then there is the whole non-moving memory blocks and related fragmentation, unless the pointers get turned into handle like ids.
- kaba0 2y agoYes, at the price of taking time away from the mutator thread, while a tracing GC can do useful work in parallel. Arguably though, especially for the early mobile devices an RC might be a better choice.