[cairo] reference counting vs garbage collection

Keith Packard keithp at keithp.com
Wed Jan 5 11:03:17 PST 2005


Around 13 o'clock on Jan 5, Carl Worth wrote:

> Regardless, it does seem easy enough to remove the conflation:
> 
> _create		Allocate object. refcnt = 1. Connect dependent objects
> _reference	refcnt++
> _finish		Finalize dependent objects
> _destroy	if (--refcnt = 0) { _finish; Free object }

(I believe the term 'close' was used instead of 'finish' in the last 
message proposing this design).

This will work just fine for me, but loses some of the symmetry in the
create/destroy ref/unref model.

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050105/b1f11677/attachment.pgp


More information about the cairo mailing list