[Fontconfig-bugs] [Bug 101889] Make fontconfig cache relocatable

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 2 14:00:55 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101889

--- Comment #17 from Behdad Esfahbod <freedesktop at behdad.org> ---
As it happens, we don't even need to change FcPattern.  We will store the files
we currently do, that makes for zero allocations in existing setups.  For
relocated use-case we will allocate lazily, similar to what Alex describe. 
Here's the details:

In FcPatternObjectGetWithBinding() if object is FC_FILE and FcRefIsConst(),
then we do some extra work to see if relocation is needed.  We find the cache
object using FcCacheFindByAddr().  If the cache object says that there's
relocation happening, then we do it.  We'll just use a hash table to map the
old string to the new string.  No need to use indices, etc.  We'll free the
hash table when the cache object is being released.  If avoiding small
allocations is desired, we can allocate 4k at a time or something.  That would
be 4k per directory.  But then again, this is one allocation for each font
actually used, so I think we should just do the small allocation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20170802/76577508/attachment.html>


More information about the Fontconfig-bugs mailing list