[Fontconfig] Reducing allocation in FcFontSetSort

Behdad Esfahbod behdad at behdad.org
Mon Jun 15 03:47:24 PDT 2009


Did you try my tree?  That will become fontconfig 2.7 soon (as soon as I can 
get away from happenings in Iran and back to work :(( )

http://mces.blogspot.com/2009/06/if-you-see-keith-packard-say-hello.html

b

On 06/15/2009 05:43 AM, Cedric BAIL wrote:
> Hi,
>
>     I am investigating why FcFontSetSort is allocating and freeing data
> around 100000 times. So I first removed the main malloc inside
> FcFontSetSort, but that's really not the main source of allocation. In
> fact all the allocation is done inside FcSortWalk and freeing is done
> by FcCharSetDestroy, when I am calling FcFontSetSort with csp == NULL
> and trim == FcTrue. And looking inside FcSortWalk, when trim ==
> FcTrue, FcCharSet will be created.
>     It's the first time I look at FontConfig source code, and my
> understanding of its code is quite limited, so does someone know why
> it is needed to create this FcCharSet, as it seems to me that we
> allocate/populate just to destroy them. Isn't it possible to change in
> file src/fcmatch.c at line 602, the test "if (trim || build_cs)" by
> just "if (build_cs)" and remove all this allocation ?
>
> Regards,
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fontconfig


More information about the Fontconfig mailing list