如何实现引用计数? [英] how to implement reference count?

查看:94
本文介绍了如何实现引用计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是引用计数以及如何在删除垃圾回收时实现它?在C中,它没有自动垃圾收集,如java.so如何在C ???

what is reference count and how to implement it in removing garbage collection??? In C it does not have automatic garbage collection like java.so how to do it in C???

推荐答案

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

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


这篇关于如何实现引用计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆