[cairo] text_to_glyphs and malloc/free

Vladimir Vukicevic vladimir at pobox.com
Thu Jun 5 19:33:29 PDT 2008


On Jun 5, 2008, at 4:28 PM, Behdad Esfahbod wrote:

> Hi,
>
> Quick question.
>
> Currently the user-font text_to_glyphs callback is expected to  
> malloc()
> the glyph array.  Cairo free()s it later.  Is that acceptable?

I would say no -- different allocators might end up being used, and  
that's bad times (especially on win32).  One easy fix is to just  
expose cairo_malloc() and cairo_free(), or, for this specific case,  
just expose a specific allocator for the glyph array  
(cairo_allocate_glyph_array(n)) and a specific deallocator for the  
other side.

    - Vlad



More information about the cairo mailing list