comparison src/redisplay.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 2b6fa2618f76
comparison
equal deleted inserted replaced
850:f915ad7befaf 851:e7ee5f8bde58
5233 { 5233 {
5234 struct display_line dl; 5234 struct display_line dl;
5235 struct display_line *dlp; 5235 struct display_line *dlp;
5236 Charcount next_pos; 5236 Charcount next_pos;
5237 int local; 5237 int local;
5238 int pos_of_dlp = -1;
5238 5239
5239 if (Dynarr_length (dla) < Dynarr_largest (dla)) 5240 if (Dynarr_length (dla) < Dynarr_largest (dla))
5240 { 5241 {
5241 dlp = Dynarr_atp (dla, Dynarr_length (dla)); 5242 pos_of_dlp = Dynarr_length (dla);
5243 dlp = Dynarr_atp (dla, pos_of_dlp);
5242 local = 0; 5244 local = 0;
5243 } 5245 }
5244 else 5246 else
5245 { 5247 {
5246 5248
5279 } 5281 }
5280 } 5282 }
5281 else 5283 else
5282 dlp->clip = 0; 5284 dlp->clip = 0;
5283 5285
5286 assert (pos_of_dlp < 0 || pos_of_dlp == Dynarr_length (dla));
5284 Dynarr_add (dla, *dlp); 5287 Dynarr_add (dla, *dlp);
5285 5288
5286 /* #### This type of check needs to be done down in the 5289 /* #### This type of check needs to be done down in the
5287 generate_display_line call. */ 5290 generate_display_line call. */
5288 if (start_pos >= s_zv) 5291 if (start_pos >= s_zv)
5378 while (ypos < yend || force) 5381 while (ypos < yend || force)
5379 { 5382 {
5380 struct display_line dl; 5383 struct display_line dl;
5381 struct display_line *dlp; 5384 struct display_line *dlp;
5382 int local; 5385 int local;
5386 int pos_of_dlp = -1;
5383 5387
5384 if (Dynarr_length (dla) < Dynarr_largest (dla)) 5388 if (Dynarr_length (dla) < Dynarr_largest (dla))
5385 { 5389 {
5386 dlp = Dynarr_atp (dla, Dynarr_length (dla)); 5390 pos_of_dlp = Dynarr_length (dla);
5391 dlp = Dynarr_atp (dla, pos_of_dlp);
5387 local = 0; 5392 local = 0;
5388 } 5393 }
5389 else 5394 else
5390 { 5395 {
5391 5396
5461 } 5466 }
5462 5467
5463 if (dlp->num_chars > w->max_line_len) 5468 if (dlp->num_chars > w->max_line_len)
5464 w->max_line_len = dlp->num_chars; 5469 w->max_line_len = dlp->num_chars;
5465 5470
5471 assert (pos_of_dlp < 0 || pos_of_dlp == Dynarr_length (dla));
5466 Dynarr_add (dla, *dlp); 5472 Dynarr_add (dla, *dlp);
5467 5473
5468 /* #### This isn't right, but it is close enough for now. */ 5474 /* #### This isn't right, but it is close enough for now. */
5469 w->window_end_pos[type] = start_pos; 5475 w->window_end_pos[type] = start_pos;
5470 5476