3 ms·
> I think if you solve this, you've implemented GC. Not necessarily. There are lots of ways around this that don't involve garbage collection. There I was thin
by kcl 14y ago
> I think if you solve this, you've implemented GC.
Not necessarily. There are lots of ways around this that don't involve garbage collection. There I was thinking specifically about static analysis suggesting Objective-C weak pointers in some cases. There are also runtime techniques (including assignment-time checking), memory profiler techniques, and the potential for simple new techniques that could make this discussion shorter. (This assumes you aren't classifying reference counting as a "garbage collection" method, which is sometimes done.) In any case, you are still in a better position than in a garbage collected language.
But that is a long discussion about garbage collection, and it is getting far afield from the subject, which is why the note doesn't go into it further. The main point is that how you handle reference cycles doesn't matter.