且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何实现引用计数?

更新时间:2021-10-05 22:40:02

引用计数不是用于删除垃圾收集,而不是即使是去除垃圾,真的。这是一种自动销毁未引用对象的技术。你可以在这里了解它:

http://en.wikipedia.org/wiki/Reference_counting [ ^ ]。



在C中实现这种技术没有问题。实际上,这正是使用 COM



-SA
Reference count is not for removing garbage collection, and not even for removing garbage, really. This is a technique for automated destruction of non-referenced objects. You can learn about it here:
http://en.wikipedia.org/wiki/Reference_counting[^].

There is no a problem to implement this technique in C. Actually, this is exactly what is normally done in C programs using COM.

—SA