[cairo] API Shakeup: cairo_current_path -> cairo_copy_path_data

Carl Worth cworth at cworth.org
Fri Mar 11 18:49:52 PST 2005


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().

On the other hand, if we were to make cairo's allocation pluggable
from above, (ie. allowing the application to tell cairo what pet
allocator to use), then the application would know to call its pet
free function as well.

Either way, I don't see a compelling need to add any abstraction here.

Or is there some other case I'm missing?

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


More information about the cairo mailing list