[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inappropriate whole-frame flicker

From: Richard Stallman
Subject: Re: inappropriate whole-frame flicker
Date: Thu, 28 Aug 2003 12:53:06 -0400

    All the values stored in struct glyph are computed while producing
    glyphs, from buffer text, properties and so on.  Functions like
    x_append_glyph fill out a glyph structure with what was computed,
    usually from a struct it.  (I've factored the glyph filling in a few
    such functions; it's not distributed in the redisplay code.)  If some
    such function leaves some struct glyph member unset, which was the
    hard to find flicker case I've been mentioning in the #if 0'd code,
    there is a problem.

    When we leave glyphs unintialized the unset glyph member has a random
    value, which is clearly a bug.

    When we bzero glyphs, the unset field has a known value of zero, but
    that's a bug as well, because the computed value may well something

    So, whatever we do, the bug remains.

We could find these bugs systematically with debugging code that would
store unlikely values (analogous 0xdeadbeef) into all the fields, then
check later on which fields have the unlikely values.  There might be
some fields for which it is hard to find a suitable unlikely value,
but if this is possible for most fields, it would find most such bugs.

We could also use a macro SET_GLYPH_FIELD (fieldname, value) which
would normally set the field using the standard place to find the
glyph.  But when DEBUG, there would be two copies of the glyph, one
initialized to all 0s and one initialized to all 1s.  Then SET_GLYPH_FIELD
would set the specified field in both glyphs.  If the two
glyphs are not identical, some field was not set.

Would someone like to implement one of these ideas, so we can find 
such bugs easily?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]