In a reference counting system, each object referenced maintains a count of how many objects are referencing it.
在引用计数系统,每个所引用的对象都会保留一个计数,以获悉有多少对象正在引用它。
Reference counting involves keeping a count of how many references to a given object are extant, then deleting the object automatically after the last one is released.
引用计数(reference counting)是对一个给定的对象当前有多少指向它的引用保留有一个计数,然后当最后一个引用被释放时自动删除该对象。
Instance counting is the easiest way of implementing garbage collection. For each reference made to the object the counter is increased, for each release it is decreased.
实例计数是实现垃圾回收的最简单的方法。对每个声明,将会使该对象的计数器增加,每个释放将使其减小。
应用推荐