[cairo] API Shakeup: cairo_current_path -> cairo_copy_path_data

Owen Taylor otaylor at redhat.com
Sat Mar 12 06:25:33 PST 2005


On Fri, 2005-03-11 at 21:49 -0500, Carl Worth wrote:
> On Tue, 22 Feb 2005 17:47:00 -0500, mental wrote:
> > Hmm.  I think it might be worth abstracting the free() -- i.e. have
> > a void cairo_free_path_data(cairo_t *cr, cairo_path_data_t *data)
> > or similar, so the door isn't totally closed on using an allocator
> > other than raw malloc().
> 
> Thinking about this a bit more, I don't think we're really closing any
> doors here. The cairo_copy_path_data call is copying data out of cairo
> and into the application, so the details of memory management should
> be on the application's terms.
> 
> That is, if we change cairo's allocator, (or make it pluggable from
> beneath the application), I would argue that this call would be exempt
> from that and the user would still be expected to call free().

I think people would find that *highly* confusing. "I've told cairo
to allocate memory via a different function, and it does so for
everything but the memory it is actually passing back to me???"

I don't think that plugging memory allocators is all that useful these
days, but if you pass back memory that the user needs to use free()
on, you've burnt the bridges there.

Regards,
						Owen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050312/d9db6ac1/attachment.pgp


More information about the cairo mailing list