Mercurial > emacs
comparison src/alloc.c @ 89943:4c90ffeb71c5
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221
Restore deleted tagline in etc/TUTORIAL.ru
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-228
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-229
Remove TeX output files from the archive
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-247
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-248
src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-249
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-263
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-264
Update from CVS: lispref/display.texi: emacs -> Emacs.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-265
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275
Update from CVS: man/makefile.w32-in: Revert last change
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-295
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-296
Allow restarting an existing debugger session that's exited
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-297
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328
Update from CVS: src/.gdbinit (xsymbol): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345
Tweak source regexps so that building in place won't cause problems
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352
Update from CVS: lisp/flymake.el: New file.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-361
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-362
Support " [...]" style defaults in minibuffer-electric-default-mode
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363
(read-number): Use canonical format for default in prompt.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-364
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-367
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368
Improve display-supports-face-attributes-p on non-ttys
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-369
Rewrite face-differs-from-default-p
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370
Move `display-supports-face-attributes-p' entirely into C code
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-371
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372
Simplify face-differs-from-default-p; don't consider :stipple.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-373
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-374
(tty_supports_face_attributes_p): Ensure attributes differ from default
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-375
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377
(Fdisplay_supports_face_attributes_p): Work around bootstrapping problem
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381
Face merging cleanups
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-382
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-384
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385
src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-386
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-395
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-396
Tweak arch tagging to make build/install-in-place less annoying
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-397
Work around vc-arch problems when building eshell
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399
Tweak directory permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401
More build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403
Yet more build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410
Make sure image types are initialized for lookup too
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416
Update from CVS
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Mon, 28 Jun 2004 07:56:49 +0000 |
| parents | 68c22ea6027c ca648e6d2d7b |
| children | 59dcbfe97385 |
comparison
equal
deleted
inserted
replaced
| 89942:9cb747ae49af | 89943:4c90ffeb71c5 |
|---|---|
| 153 | 153 |
| 154 /* Two limits controlling how much undo information to keep. */ | 154 /* Two limits controlling how much undo information to keep. */ |
| 155 | 155 |
| 156 EMACS_INT undo_limit; | 156 EMACS_INT undo_limit; |
| 157 EMACS_INT undo_strong_limit; | 157 EMACS_INT undo_strong_limit; |
| 158 EMACS_INT undo_outer_limit; | |
| 158 | 159 |
| 159 /* Number of live and free conses etc. */ | 160 /* Number of live and free conses etc. */ |
| 160 | 161 |
| 161 static int total_conses, total_markers, total_symbols, total_vector_size; | 162 static int total_conses, total_markers, total_symbols, total_vector_size; |
| 162 static int total_free_conses, total_free_markers, total_free_symbols; | 163 static int total_free_conses, total_free_markers, total_free_symbols; |
| 254 Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ | 255 Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ |
| 255 EMACS_INT gcs_done; /* accumulated GCs */ | 256 EMACS_INT gcs_done; /* accumulated GCs */ |
| 256 | 257 |
| 257 static void mark_buffer P_ ((Lisp_Object)); | 258 static void mark_buffer P_ ((Lisp_Object)); |
| 258 extern void mark_kboards P_ ((void)); | 259 extern void mark_kboards P_ ((void)); |
| 260 extern void mark_backtrace P_ ((void)); | |
| 259 static void gc_sweep P_ ((void)); | 261 static void gc_sweep P_ ((void)); |
| 260 static void mark_glyph_matrix P_ ((struct glyph_matrix *)); | 262 static void mark_glyph_matrix P_ ((struct glyph_matrix *)); |
| 261 static void mark_face_cache P_ ((struct face_cache *)); | 263 static void mark_face_cache P_ ((struct face_cache *)); |
| 262 | 264 |
| 263 #ifdef HAVE_WINDOW_SYSTEM | 265 #ifdef HAVE_WINDOW_SYSTEM |
| 751 #endif | 753 #endif |
| 752 | 754 |
| 753 #ifdef HAVE_POSIX_MEMALIGN | 755 #ifdef HAVE_POSIX_MEMALIGN |
| 754 { | 756 { |
| 755 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); | 757 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); |
| 756 abase = err ? (base = NULL) : base; | 758 if (err) |
| 759 base = NULL; | |
| 760 abase = base; | |
| 757 } | 761 } |
| 758 #else | 762 #else |
| 759 base = malloc (ABLOCKS_BYTES); | 763 base = malloc (ABLOCKS_BYTES); |
| 760 abase = ALIGN (base, BLOCK_ALIGN); | 764 abase = ALIGN (base, BLOCK_ALIGN); |
| 765 #endif | |
| 766 | |
| 761 if (base == 0) | 767 if (base == 0) |
| 762 { | 768 { |
| 763 UNBLOCK_INPUT; | 769 UNBLOCK_INPUT; |
| 764 memory_full (); | 770 memory_full (); |
| 765 } | 771 } |
| 766 #endif | |
| 767 | 772 |
| 768 aligned = (base == abase); | 773 aligned = (base == abase); |
| 769 if (!aligned) | 774 if (!aligned) |
| 770 ((void**)abase)[-1] = base; | 775 ((void**)abase)[-1] = base; |
| 771 | 776 |
| 842 /* Put on free list. */ | 847 /* Put on free list. */ |
| 843 ablock->x.next_free = free_ablock; | 848 ablock->x.next_free = free_ablock; |
| 844 free_ablock = ablock; | 849 free_ablock = ablock; |
| 845 /* Update busy count. */ | 850 /* Update busy count. */ |
| 846 ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); | 851 ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); |
| 847 | 852 |
| 848 if (2 > (long) ABLOCKS_BUSY (abase)) | 853 if (2 > (long) ABLOCKS_BUSY (abase)) |
| 849 { /* All the blocks are free. */ | 854 { /* All the blocks are free. */ |
| 850 int i = 0, aligned = (long) ABLOCKS_BUSY (abase); | 855 int i = 0, aligned = (long) ABLOCKS_BUSY (abase); |
| 851 struct ablock **tem = &free_ablock; | 856 struct ablock **tem = &free_ablock; |
| 852 struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1]; | 857 struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1]; |
| 1891 current_sblock = tb; | 1896 current_sblock = tb; |
| 1892 } | 1897 } |
| 1893 | 1898 |
| 1894 | 1899 |
| 1895 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, | 1900 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, |
| 1896 doc: /* Return a newly created string of length LENGTH, with each element being INIT. | 1901 doc: /* Return a newly created string of length LENGTH, with INIT in each element. |
| 1897 Both LENGTH and INIT must be numbers. */) | 1902 LENGTH must be an integer. |
| 1903 INIT must be an integer that represents a character. */) | |
| 1898 (length, init) | 1904 (length, init) |
| 1899 Lisp_Object length, init; | 1905 Lisp_Object length, init; |
| 1900 { | 1906 { |
| 1901 register Lisp_Object val; | 1907 register Lisp_Object val; |
| 1902 register unsigned char *p, *end; | 1908 register unsigned char *p, *end; |
| 1947 int real_init, i; | 1953 int real_init, i; |
| 1948 int length_in_chars, length_in_elts, bits_per_value; | 1954 int length_in_chars, length_in_elts, bits_per_value; |
| 1949 | 1955 |
| 1950 CHECK_NATNUM (length); | 1956 CHECK_NATNUM (length); |
| 1951 | 1957 |
| 1952 bits_per_value = sizeof (EMACS_INT) * BITS_PER_CHAR; | 1958 bits_per_value = sizeof (EMACS_INT) * BOOL_VECTOR_BITS_PER_CHAR; |
| 1953 | 1959 |
| 1954 length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; | 1960 length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; |
| 1955 length_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1) / BITS_PER_CHAR); | 1961 length_in_chars = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1) |
| 1962 / BOOL_VECTOR_BITS_PER_CHAR); | |
| 1956 | 1963 |
| 1957 /* We must allocate one more elements than LENGTH_IN_ELTS for the | 1964 /* We must allocate one more elements than LENGTH_IN_ELTS for the |
| 1958 slot `size' of the struct Lisp_Bool_Vector. */ | 1965 slot `size' of the struct Lisp_Bool_Vector. */ |
| 1959 val = Fmake_vector (make_number (length_in_elts + 1), Qnil); | 1966 val = Fmake_vector (make_number (length_in_elts + 1), Qnil); |
| 1960 p = XBOOL_VECTOR (val); | 1967 p = XBOOL_VECTOR (val); |
| 1967 real_init = (NILP (init) ? 0 : -1); | 1974 real_init = (NILP (init) ? 0 : -1); |
| 1968 for (i = 0; i < length_in_chars ; i++) | 1975 for (i = 0; i < length_in_chars ; i++) |
| 1969 p->data[i] = real_init; | 1976 p->data[i] = real_init; |
| 1970 | 1977 |
| 1971 /* Clear the extraneous bits in the last byte. */ | 1978 /* Clear the extraneous bits in the last byte. */ |
| 1972 if (XINT (length) != length_in_chars * BITS_PER_CHAR) | 1979 if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) |
| 1973 XBOOL_VECTOR (val)->data[length_in_chars - 1] | 1980 XBOOL_VECTOR (val)->data[length_in_chars - 1] |
| 1974 &= (1 << (XINT (length) % BITS_PER_CHAR)) - 1; | 1981 &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; |
| 1975 | 1982 |
| 1976 return val; | 1983 return val; |
| 1977 } | 1984 } |
| 1978 | 1985 |
| 1979 | 1986 |
| 2330 #if GC_MARK_STACK | 2337 #if GC_MARK_STACK |
| 2331 ptr->car = Vdead; | 2338 ptr->car = Vdead; |
| 2332 #endif | 2339 #endif |
| 2333 cons_free_list = ptr; | 2340 cons_free_list = ptr; |
| 2334 } | 2341 } |
| 2335 | |
| 2336 | 2342 |
| 2337 DEFUN ("cons", Fcons, Scons, 2, 2, 0, | 2343 DEFUN ("cons", Fcons, Scons, 2, 2, 0, |
| 2338 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) | 2344 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) |
| 2339 (car, cdr) | 2345 (car, cdr) |
| 2340 Lisp_Object car, cdr; | 2346 Lisp_Object car, cdr; |
| 4231 Lisp_Object tag; | 4237 Lisp_Object tag; |
| 4232 Lisp_Object val; | 4238 Lisp_Object val; |
| 4233 struct catchtag *next; | 4239 struct catchtag *next; |
| 4234 }; | 4240 }; |
| 4235 | 4241 |
| 4236 struct backtrace | |
| 4237 { | |
| 4238 struct backtrace *next; | |
| 4239 Lisp_Object *function; | |
| 4240 Lisp_Object *args; /* Points to vector of args. */ | |
| 4241 int nargs; /* Length of vector. */ | |
| 4242 /* If nargs is UNEVALLED, args points to slot holding list of | |
| 4243 unevalled args. */ | |
| 4244 char evalargs; | |
| 4245 }; | |
| 4246 | |
| 4247 | |
| 4248 | 4242 |
| 4249 /*********************************************************************** | 4243 /*********************************************************************** |
| 4250 Protection from GC | 4244 Protection from GC |
| 4251 ***********************************************************************/ | 4245 ***********************************************************************/ |
| 4252 | 4246 |
| 4277 () | 4271 () |
| 4278 { | 4272 { |
| 4279 register struct specbinding *bind; | 4273 register struct specbinding *bind; |
| 4280 struct catchtag *catch; | 4274 struct catchtag *catch; |
| 4281 struct handler *handler; | 4275 struct handler *handler; |
| 4282 register struct backtrace *backlist; | |
| 4283 char stack_top_variable; | 4276 char stack_top_variable; |
| 4284 register int i; | 4277 register int i; |
| 4285 int message_p; | 4278 int message_p; |
| 4286 Lisp_Object total[8]; | 4279 Lisp_Object total[8]; |
| 4287 int count = SPECPDL_INDEX (); | 4280 int count = SPECPDL_INDEX (); |
| 4346 Qt tends to return NULL, which effectively turns undo back on. | 4339 Qt tends to return NULL, which effectively turns undo back on. |
| 4347 So don't call truncate_undo_list if undo_list is Qt. */ | 4340 So don't call truncate_undo_list if undo_list is Qt. */ |
| 4348 if (! EQ (nextb->undo_list, Qt)) | 4341 if (! EQ (nextb->undo_list, Qt)) |
| 4349 nextb->undo_list | 4342 nextb->undo_list |
| 4350 = truncate_undo_list (nextb->undo_list, undo_limit, | 4343 = truncate_undo_list (nextb->undo_list, undo_limit, |
| 4351 undo_strong_limit); | 4344 undo_strong_limit, undo_outer_limit); |
| 4352 | 4345 |
| 4353 /* Shrink buffer gaps, but skip indirect and dead buffers. */ | 4346 /* Shrink buffer gaps, but skip indirect and dead buffers. */ |
| 4354 if (nextb->base_buffer == 0 && !NILP (nextb->name)) | 4347 if (nextb->base_buffer == 0 && !NILP (nextb->name)) |
| 4355 { | 4348 { |
| 4356 /* If a buffer's gap size is more than 10% of the buffer | 4349 /* If a buffer's gap size is more than 10% of the buffer |
| 4406 for (handler = handlerlist; handler; handler = handler->next) | 4399 for (handler = handlerlist; handler; handler = handler->next) |
| 4407 { | 4400 { |
| 4408 mark_object (handler->handler); | 4401 mark_object (handler->handler); |
| 4409 mark_object (handler->var); | 4402 mark_object (handler->var); |
| 4410 } | 4403 } |
| 4411 for (backlist = backtrace_list; backlist; backlist = backlist->next) | 4404 mark_backtrace (); |
| 4412 { | |
| 4413 mark_object (*backlist->function); | |
| 4414 | |
| 4415 if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) | |
| 4416 i = 0; | |
| 4417 else | |
| 4418 i = backlist->nargs - 1; | |
| 4419 for (; i >= 0; i--) | |
| 4420 mark_object (backlist->args[i]); | |
| 4421 } | |
| 4422 mark_kboards (); | 4405 mark_kboards (); |
| 4423 | 4406 |
| 4424 /* Look thru every buffer's undo list | 4407 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
| 4408 mark_stack (); | |
| 4409 #endif | |
| 4410 | |
| 4411 #ifdef USE_GTK | |
| 4412 { | |
| 4413 extern void xg_mark_data (); | |
| 4414 xg_mark_data (); | |
| 4415 } | |
| 4416 #endif | |
| 4417 | |
| 4418 /* Everything is now marked, except for the things that require special | |
| 4419 finalization, i.e. the undo_list. | |
| 4420 Look thru every buffer's undo list | |
| 4425 for elements that update markers that were not marked, | 4421 for elements that update markers that were not marked, |
| 4426 and delete them. */ | 4422 and delete them. */ |
| 4427 { | 4423 { |
| 4428 register struct buffer *nextb = all_buffers; | 4424 register struct buffer *nextb = all_buffers; |
| 4429 | 4425 |
| 4457 prev = tail; | 4453 prev = tail; |
| 4458 tail = XCDR (tail); | 4454 tail = XCDR (tail); |
| 4459 } | 4455 } |
| 4460 } | 4456 } |
| 4461 } | 4457 } |
| 4458 /* Now that we have stripped the elements that need not be in the | |
| 4459 undo_list any more, we can finally mark the list. */ | |
| 4460 mark_object (nextb->undo_list); | |
| 4462 | 4461 |
| 4463 nextb = nextb->next; | 4462 nextb = nextb->next; |
| 4464 } | 4463 } |
| 4465 } | 4464 } |
| 4466 | |
| 4467 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | |
| 4468 mark_stack (); | |
| 4469 #endif | |
| 4470 | |
| 4471 #ifdef USE_GTK | |
| 4472 { | |
| 4473 extern void xg_mark_data (); | |
| 4474 xg_mark_data (); | |
| 4475 } | |
| 4476 #endif | |
| 4477 | 4465 |
| 4478 gc_sweep (); | 4466 gc_sweep (); |
| 4479 | 4467 |
| 4480 /* Clear the mark bits that we set in certain root slots. */ | 4468 /* Clear the mark bits that we set in certain root slots. */ |
| 4481 | 4469 |
| 5041 | 5029 |
| 5042 VECTOR_MARK (buffer); | 5030 VECTOR_MARK (buffer); |
| 5043 | 5031 |
| 5044 MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); | 5032 MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); |
| 5045 | 5033 |
| 5046 if (CONSP (buffer->undo_list)) | 5034 /* For now, we just don't mark the undo_list. It's done later in |
| 5047 { | 5035 a special way just before the sweep phase, and after stripping |
| 5048 Lisp_Object tail; | 5036 some of its elements that are not needed any more. */ |
| 5049 tail = buffer->undo_list; | |
| 5050 | |
| 5051 /* We mark the undo list specially because | |
| 5052 its pointers to markers should be weak. */ | |
| 5053 | |
| 5054 while (CONSP (tail)) | |
| 5055 { | |
| 5056 register struct Lisp_Cons *ptr = XCONS (tail); | |
| 5057 | |
| 5058 if (CONS_MARKED_P (ptr)) | |
| 5059 break; | |
| 5060 CONS_MARK (ptr); | |
| 5061 if (GC_CONSP (ptr->car) | |
| 5062 && !CONS_MARKED_P (XCONS (ptr->car)) | |
| 5063 && GC_MARKERP (XCAR (ptr->car))) | |
| 5064 { | |
| 5065 CONS_MARK (XCONS (ptr->car)); | |
| 5066 mark_object (XCDR (ptr->car)); | |
| 5067 } | |
| 5068 else | |
| 5069 mark_object (ptr->car); | |
| 5070 | |
| 5071 if (CONSP (ptr->cdr)) | |
| 5072 tail = ptr->cdr; | |
| 5073 else | |
| 5074 break; | |
| 5075 } | |
| 5076 | |
| 5077 mark_object (XCDR (tail)); | |
| 5078 } | |
| 5079 else | |
| 5080 mark_object (buffer->undo_list); | |
| 5081 | 5037 |
| 5082 if (buffer->overlays_before) | 5038 if (buffer->overlays_before) |
| 5083 { | 5039 { |
| 5084 XSETMISC (tmp, buffer->overlays_before); | 5040 XSETMISC (tmp, buffer->overlays_before); |
| 5085 mark_object (tmp); | 5041 mark_object (tmp); |
| 5669 which includes both saved text and other data. */); | 5625 which includes both saved text and other data. */); |
| 5670 undo_limit = 20000; | 5626 undo_limit = 20000; |
| 5671 | 5627 |
| 5672 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, | 5628 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, |
| 5673 doc: /* Don't keep more than this much size of undo information. | 5629 doc: /* Don't keep more than this much size of undo information. |
| 5674 A command which pushes past this size is itself forgotten. | 5630 A previous command which pushes the undo list past this size |
| 5675 This limit is applied when garbage collection happens. | 5631 is entirely forgotten when GC happens. |
| 5676 The size is counted as the number of bytes occupied, | 5632 The size is counted as the number of bytes occupied, |
| 5677 which includes both saved text and other data. */); | 5633 which includes both saved text and other data. */); |
| 5678 undo_strong_limit = 30000; | 5634 undo_strong_limit = 30000; |
| 5635 | |
| 5636 DEFVAR_INT ("undo-outer-limit", &undo_outer_limit, | |
| 5637 doc: /* Don't keep more than this much size of undo information. | |
| 5638 If the current command has produced more than this much undo information, | |
| 5639 GC discards it. This is a last-ditch limit to prevent memory overflow. | |
| 5640 The size is counted as the number of bytes occupied, | |
| 5641 which includes both saved text and other data. */); | |
| 5642 undo_outer_limit = 300000; | |
| 5679 | 5643 |
| 5680 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, | 5644 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, |
| 5681 doc: /* Non-nil means display messages at start and end of garbage collection. */); | 5645 doc: /* Non-nil means display messages at start and end of garbage collection. */); |
| 5682 garbage_collection_messages = 0; | 5646 garbage_collection_messages = 0; |
| 5683 | 5647 |
