3 ms·
Grandparent is correct. Reference counting is a garbage collection mechanism. In same way a bubble sort is a sort. It doesn't care about ownership either. Apar
by Ygg2 4y ago
Grandparent is correct. Reference counting is a garbage collection mechanism. In same way a bubble sort is a sort.
It doesn't care about ownership either. Apart from some Swift specific optimizations iiuc.
Full GC I mentioned is more of mark and sweep variety.
- furyofantares 4y agoAlright, malloc/free is also garbage collection then.
- Ygg2 4y agohttps://en.wikipedia.org/wiki/Garbage_collection_(computer_science) https://en.wikipedia.org/wiki/Garbage_collection_(computer_s... See Reference counting. Note lack of malloc/free.
- mattgreenrocks 4y agoRef counting is considered GC (despite the colloquial definition excluding it) because RC handles the same problem domain as full GC, even with drawbacks around cycles. malloc/free, on the other hand, are just ways to allocate and release memory. They're too low level to be garbage collection. See this excellent comment: https://news.ycombinator.com/item?id=32277088 https://news.ycombinator.com/item?id=32277088