comparison src/redisplay-output.c @ 851:e7ee5f8bde58

[xemacs-hg @ 2002-05-23 11:46:08 by ben] fix for raymond toy's crash, alloca crashes, some recover-session improvements files.el: Recover-session improvements: Only show session files where some files can actually be recovered, and show in chronological order. subr.el, menubar-items.el: As promised to rms, the functionality in truncate-string-with-continuation-dots has been merged into truncate-string-to-width. Change callers in menubar-items.el. select.el: Document some of these funs better. Fix problem where we were doing own-clipboard twice. Makefile.in.in: Add alloca.o. Ensure that alloca.s doesn't compile into alloca.o, but allocax.o (not that it's currently used or anything.) EmacsFrame.c, abbrev.c, alloc.c, alloca.c, callint.c, callproc.c, config.h.in, device-msw.c, device-x.c, dired.c, doc.c, editfns.c, emacs.c, emodules.c, eval.c, event-Xt.c, event-msw.c, event-stream.c, file-coding.c, fileio.c, filelock.c, fns.c, glyphs-gtk.c, glyphs-msw.c, glyphs-x.c, gui-x.c, input-method-xlib.c, intl-win32.c, lisp.h, lread.c, menubar-gtk.c, menubar-msw.c, menubar.c, mule-wnnfns.c, nt.c, objects-msw.c, process-nt.c, realpath.c, redisplay-gtk.c, redisplay-output.c, redisplay-x.c, redisplay.c, search.c, select-msw.c, sysdep.c, syswindows.h, text.c, text.h, ui-byhand.c: Fix Raymond Toy's crash. Repeat to self: 2^21 - 1 is NOT the same as (2 << 21) - 1. Fix crashes due to excessive alloca(). replace alloca() with ALLOCA(), which calls the C alloca() [which uses xmalloc()] when the size is too big. Insert in various places calls to try to flush the C alloca() stored info if there is any. Add MALLOC_OR_ALLOCA(), for places that expect to be alloca()ing large blocks. This xmalloc()s when too large and records an unwind-protect to free -- relying on the caller to unbind_to() elsewhere in the function. Use it in concat(). Use MALLOC instead of ALLOCA in select-msw.c. xemacs.mak: Add alloca.o.
author ben
date Thu, 23 May 2002 11:46:46 +0000
parents 6728e641994e
children 42375619fa45
comparison
equal deleted inserted replaced
850:f915ad7befaf 851:e7ee5f8bde58
303 return 0; 303 return 0;
304 else 304 else
305 return 1; 305 return 1;
306 } 306 }
307 307
308 #if 0
309 void
310 compare_runes_2 (struct window *w, struct rune *crb, struct rune *drb)
311 {
312 if (crb->type == DGLYPH)
313 {
314 if (!EQ (crb->object.dglyph.glyph, drb->object.dglyph.glyph) ||
315 !EQ (crb->object.dglyph.extent, drb->object.dglyph.extent) ||
316 crb->object.dglyph.xoffset != drb->object.dglyph.xoffset ||
317 crb->object.dglyph.yoffset != drb->object.dglyph.yoffset ||
318 crb->object.dglyph.ascent != drb->object.dglyph.ascent ||
319 crb->object.dglyph.descent != drb->object.dglyph.descent)
320 return 0;
321 /* Only check dirtiness if we know something has changed. */
322 else if (XGLYPH_DIRTYP (crb->object.dglyph.glyph) ||
323 crb->findex != drb->findex)
324 {
325 /* We need some way of telling redisplay_output_layout () that the
326 only reason we are outputting it is because something has
327 changed internally. That way we can optimize whether we need
328 to clear the layout first and also only output the components
329 that have changed. The image_instance dirty flag and
330 display_hash are no good to us because these will invariably
331 have been set anyway if the layout has changed. So it looks
332 like we need yet another change flag that we can set here and
333 then clear in redisplay_output_layout (). */
334 Lisp_Object window, image;
335 Lisp_Image_Instance* ii;
336 window = wrap_window (w);
337 image = glyph_image_instance (crb->object.dglyph.glyph,
338 window, crb->object.dglyph.matchspec,
339 ERROR_ME_DEBUG_WARN, 1);
340
341 if (!IMAGE_INSTANCEP (image))
342 return 0;
343 ii = XIMAGE_INSTANCE (image);
344
345 if (TEXT_IMAGE_INSTANCEP (image) &&
346 (crb->findex != drb->findex ||
347 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)))
348 return 0;
349
350 /* It is quite common for the two glyphs to be EQ since in many
351 cases they will actually be the same object. This does not
352 mean, however, that nothing has changed. We therefore need to
353 check the current hash of the glyph against the last recorded
354 display hash and the pending display items. See
355 update_widget () ^^#### which function?. */
356 if (image_instance_changed (image) ||
357 crb->findex != drb->findex ||
358 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))
359 {
360 /* Now we are going to re-output the glyph, but since
361 this is for some internal reason not related to geometry
362 changes, send a hint to the output routines that they can
363 take some short cuts. This is most useful for
364 layouts. This flag should get reset by the output
365 routines.
366
367 #### It is possible for us to get here when the
368 face_cachel is dirty. I do not know what the implications
369 of this are.*/
370 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (ii) = 1;
371 return 0;
372 }
373 else
374 return 1;
375 }
376 else if (crb->findex != drb->findex ||
377 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))
378 return 0;
379 else
380 return 1;
381 }
382 else return !(memcmp (crb, drb, sizeof (*crb)) ||
383 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex));
384 }
385 #endif
386
387
308 /***************************************************************************** 388 /*****************************************************************************
309 get_next_display_block 389 get_next_display_block
310 390
311 Return the next display starting at or overlapping START_POS. Return 391 Return the next display starting at or overlapping START_POS. Return
312 the start of the next region in NEXT_START. 392 the start of the next region in NEXT_START.