Mercurial > hg > xemacs-beta
comparison src/redisplay.c @ 5587:3fde0e346ad7
Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
* frame.c (Fmake_frame): Ensure that reset_glyph_cachels gets called.
(setup_minibuffer_frame): Improve header comment.
* redisplay.c (redisplay_window): Update comment.
Remove code checking for uninitialized face_cachels and glyph_cachels.
Can't happen in theory, and guarded by asserts in practice.
* window.c (allocate_window): Update comment on reset_*_cachels.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Sat, 29 Oct 2011 00:35:33 +0900 |
parents | 56144c8593a8 |
children | b0d712bbc2a6 |
comparison
equal
deleted
inserted
replaced
5586:d8a11d5ebc9f | 5587:3fde0e346ad7 |
---|---|
6304 | 6304 |
6305 /* Added 2-1-10 -- we should never have empty face or glyph cachels | 6305 /* Added 2-1-10 -- we should never have empty face or glyph cachels |
6306 because we initialized them at startup and the only way to reduce | 6306 because we initialized them at startup and the only way to reduce |
6307 their number is through calling reset_face_cachels() or | 6307 their number is through calling reset_face_cachels() or |
6308 reset_glyph_cachels(), which as a side effect sets up a number of | 6308 reset_glyph_cachels(), which as a side effect sets up a number of |
6309 standard entries */ | 6309 standard entries |
6310 2011-10-29 -- We were managing to hit the glyph_cachels assert in certain | |
6311 contexts where VM was creating a lot of frames. I don't have a full | |
6312 analysis, but I suspect that we were failing to setup the glyph_cachels | |
6313 at about l. 961 of frame.c, and a message was being sent to the echo area | |
6314 before the initialization was complete. This triggered a redisplay of | |
6315 the minibuffer window (this part is confirmed), and thus this assert. */ | |
6310 assert (Dynarr_length (w->face_cachels)); | 6316 assert (Dynarr_length (w->face_cachels)); |
6311 assert (Dynarr_length (w->glyph_cachels)); | 6317 assert (Dynarr_length (w->glyph_cachels)); |
6312 | 6318 |
6313 /* If the buffer has changed we have to invalidate all of our face | 6319 /* If the buffer has changed we have to invalidate all of our face |
6314 cache elements. */ | 6320 cache elements. */ |
6315 if ((!echo_active && b != window_display_buffer (w)) | 6321 if ((!echo_active && b != window_display_buffer (w)) |
6316 #if 0 | |
6317 /* #### Delete this code sometime later than 2-1-10 when we're sure it's | |
6318 not needed */ | |
6319 || !Dynarr_length (w->face_cachels) | |
6320 #endif | |
6321 || f->faces_changed) | 6322 || f->faces_changed) |
6322 reset_face_cachels (w); | 6323 reset_face_cachels (w); |
6323 else | 6324 else |
6324 mark_face_cachels_as_not_updated (w); | 6325 mark_face_cachels_as_not_updated (w); |
6325 | 6326 |
6326 /* Ditto the glyph cache elements, although we do *not* invalidate | 6327 /* Ditto the glyph cache elements, although we do *not* invalidate |
6327 the cache purely because glyphs have changed - this is now | 6328 the cache purely because glyphs have changed - this is now |
6328 handled by the dirty flag.*/ | 6329 handled by the dirty flag.*/ |
6329 if ((!echo_active && b != window_display_buffer (w)) | 6330 if ((!echo_active && b != window_display_buffer (w)) |
6330 #if 0 | |
6331 /* #### Delete this code sometime later than 2-1-10 when we're sure it's | |
6332 not needed */ | |
6333 || !Dynarr_length (w->glyph_cachels) | |
6334 #endif | |
6335 || f->faces_changed) | 6331 || f->faces_changed) |
6336 reset_glyph_cachels (w); | 6332 reset_glyph_cachels (w); |
6337 else | 6333 else |
6338 mark_glyph_cachels_as_not_updated (w); | 6334 mark_glyph_cachels_as_not_updated (w); |
6339 | 6335 |