[PATCH 1/7] render: Inline common FindGlyph case
Keith Packard
keithp at keithp.com
Mon May 11 23:12:59 PDT 2015
Dave Airlie <airlied at gmail.com> writes:
>> + GlyphHashPtr hash = &glyphSet->hash;
>> + GlyphRefPtr gr = &hash->table[id % hash->hashSet->size];
>
> I'm not sure if I'm right,
>
> but should this check gr == DeletedGlyph?
I think you probably mean:
gr->glyph == DeletedGlyph && gr->glyph != NULL
Yes, that might well resolve my 'missing glyphs' problem with a
long-running firefox instance, which may well be doing some glyph
deleting in response to memory pressure.
I think this is a better fix though, and takes advantage of 0 being an
undefined glyph, by simply resetting the signature value to zero when
deleting a glyph:
diff --git a/render/glyph.c b/render/glyph.c
index 4a4f11b..86ec7aa 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -322,6 +322,7 @@ DeleteGlyph(GlyphSetPtr glyphSet, Glyph id)
glyph = gr->glyph;
if (glyph && glyph != DeletedGlyph) {
gr->glyph = DeletedGlyph;
+ gr->signature = 0;
glyphSet->hash.tableEntries--;
FreeGlyph(glyph, glyphSet->fdepth);
return TRUE;
--
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150511/542bd7c9/attachment.sig>
More information about the xorg-devel
mailing list