3 ms·
Go & Java don't do reference counting. They have a GC instead.
by amenghra 6y ago
Go & Java don't do reference counting. They have a GC instead.
- pjmlp 6y agoWrong, reference counting is a GC algorithm, and both language specifications don't state what exact algorithm is to be implemented. In fact there are tons of GC implementations across all Java implementations, including reference counting. For example, "An on-the-fly reference-counting garbage collector for java" https://dl.acm.org/doi/10.1145/1111596.1111597 https://dl.acm.org/doi/10.1145/1111596.1111597 And here is one for Go. https://github.com/sendilkumarn/gopurerc https://github.com/sendilkumarn/gopurerc