[cairo] reference counting vs garbage collection

Keith Packard keithp at keithp.com
Wed Jan 5 11:00:56 PST 2005


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

> I guess my mental block is that I can't see why an application would
> want to call a "finish" function. It sounds to me like, "Render this
> object useless, but let me still hold on to it".

Yup.  In a GC language binding, you provide the application with the
explicit 'close' function to push output to the file, but you don't provide
any deallocation function as that must be handled by the GC system.

Separating these two activities makes it possible to catch errors caused 
by reusing data after it's been 'closed', something a GC'd language is 
supposed to guarantee.

-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/49f2dedf/attachment.pgp


More information about the cairo mailing list