Questions tagged «reference-counting»

5
内存管理语言的参考计数模式?
Java和.NET都为你管理内存美妙的垃圾收集器,方便的方式快速释放的外部对象(Closeable,IDisposable),但只有当他们是由一个单一的对象所拥有。在某些系统中,可能需要由两个组件独立消耗资源,并且仅在两个组件都释放资源时才释放资源。 在现代C ++中,您可以使用来解决此问题,shared_ptr当所有shared_ptr都被销毁时,它将确定性地释放资源。 在面向对象的,不确定的垃圾收集系统中,是否有任何记录的,经过验证的模式来管理和释放昂贵的资源,这些资源没有一个所有者?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.