
2 Dec
2013
2 Dec
'13
3:37 p.m.
On Mon, Dec 02, 2013 at 02:57:06PM +0200, Avi Kivity wrote:
This provides a way to escape from automatic reference counting, and taking manual control of the reference. Useful when interfacing to a C API that expects a pointer with an elevated reference count.
Similar to std::unique_ptr<>::release().
Running the risk of bikeshedding, the name could be a bit misleading to some. Examples: CComPtr::Release reduces the refcount. intrusive_ptr_release reduces the refcount. For prior art, CComPtr uses 'Detach' to indicate disowning with retained refcount, and symmetrically 'Attach' to acquiring reponsibility for a pointer without adding refcount. -- Lars Viklund | zao@acc.umu.se