<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Make fontconfig cache relocatable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101889#c16">Comment # 16</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Make fontconfig cache relocatable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101889">bug 101889</a>
from <span class="vcard"><a class="email" href="mailto:freedesktop@behdad.org" title="Behdad Esfahbod <freedesktop@behdad.org>"> <span class="fn">Behdad Esfahbod</span></a>
</span></b>
<pre>(In reply to Behdad Esfahbod from <a href="show_bug.cgi?id=101889#c15">comment #15</a>)
<span class="quote">> (In reply to Alexander Larsson from <a href="show_bug.cgi?id=101889#c13">comment #13</a>)
> > Yes, we could do it lazily, true. However, I don't understand what you mean
> > about sharing with others.
>
> When the mapped file is not modified, the backing memory is shared across
> processes. They are copy-on-write. If we can completely avoid changing is
> even better. I have a scheme in mind that does that.
>
>
> > Here is what i imagine:
> >
> > [Shared mmaped cache data]
> > ...
> > FontName="TheFont"
> > FileName=offset 0
> > ...
> > FontName="OtherFont"
> > FileName=offset 1
> > ...
> > FileNameTable
> > [offset 0]
> > [offset 12]
> > FileNameStrings
> > "TheFont.ttf\0OtherFont.ttf\0"
> >
> > This would be readonly and shared by all clients.
> > To go from a cache element to a filename you would normally
> > go from offset in FileNameTable to offset in FileNameStrings, all shared by
> > everyone. However, in the case where the cache is loaded in a non-canonical
> > location, you'd allocate an in-memory (non-shared) FileNameTable and
> > FileNameStrings array, which would would rewrite and use instead.
> >
> > Such a setup could be lazy, either doing everything the first time you get a
> > filename, or it could allocate filenames one-by-one lazily. (Although then
> > you create a lot of small allocations instead of a single large one.</span >
Yes, I have something very similar to that in mind. It's doable.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>