3 ms·
Alright, malloc/free is also garbage collection then.
by furyofantares 4y ago
Alright, 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