Mercurial > emacs
comparison src/alloc.c @ 83143:9fb10038ca55
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-354
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-355
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-356
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-183
| author | Karoly Lorentey <lorentey@elte.hu> |
|---|---|
| date | Mon, 31 May 2004 13:48:26 +0000 |
| parents | 62cf3d6337a0 ca648e6d2d7b |
| children | dbcd0af66869 |
comparison
equal
deleted
inserted
replaced
| 83142:62cf3d6337a0 | 83143:9fb10038ca55 |
|---|---|
| 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; |
| 753 #endif | 754 #endif |
| 754 | 755 |
| 755 #ifdef HAVE_POSIX_MEMALIGN | 756 #ifdef HAVE_POSIX_MEMALIGN |
| 756 { | 757 { |
| 757 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); | 758 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); |
| 758 abase = err ? (base = NULL) : base; | 759 if (err) |
| 760 base = NULL; | |
| 761 abase = base; | |
| 759 } | 762 } |
| 760 #else | 763 #else |
| 761 base = malloc (ABLOCKS_BYTES); | 764 base = malloc (ABLOCKS_BYTES); |
| 762 abase = ALIGN (base, BLOCK_ALIGN); | 765 abase = ALIGN (base, BLOCK_ALIGN); |
| 766 #endif | |
| 767 | |
| 763 if (base == 0) | 768 if (base == 0) |
| 764 { | 769 { |
| 765 UNBLOCK_INPUT; | 770 UNBLOCK_INPUT; |
| 766 memory_full (); | 771 memory_full (); |
| 767 } | 772 } |
| 768 #endif | |
| 769 | 773 |
| 770 aligned = (base == abase); | 774 aligned = (base == abase); |
| 771 if (!aligned) | 775 if (!aligned) |
| 772 ((void**)abase)[-1] = base; | 776 ((void**)abase)[-1] = base; |
| 773 | 777 |
| 4379 Qt tends to return NULL, which effectively turns undo back on. | 4383 Qt tends to return NULL, which effectively turns undo back on. |
| 4380 So don't call truncate_undo_list if undo_list is Qt. */ | 4384 So don't call truncate_undo_list if undo_list is Qt. */ |
| 4381 if (! EQ (nextb->undo_list, Qt)) | 4385 if (! EQ (nextb->undo_list, Qt)) |
| 4382 nextb->undo_list | 4386 nextb->undo_list |
| 4383 = truncate_undo_list (nextb->undo_list, undo_limit, | 4387 = truncate_undo_list (nextb->undo_list, undo_limit, |
| 4384 undo_strong_limit); | 4388 undo_strong_limit, undo_outer_limit); |
| 4385 | 4389 |
| 4386 /* Shrink buffer gaps, but skip indirect and dead buffers. */ | 4390 /* Shrink buffer gaps, but skip indirect and dead buffers. */ |
| 4387 if (nextb->base_buffer == 0 && !NILP (nextb->name)) | 4391 if (nextb->base_buffer == 0 && !NILP (nextb->name)) |
| 4388 { | 4392 { |
| 4389 /* If a buffer's gap size is more than 10% of the buffer | 4393 /* If a buffer's gap size is more than 10% of the buffer |
| 5666 which includes both saved text and other data. */); | 5670 which includes both saved text and other data. */); |
| 5667 undo_limit = 20000; | 5671 undo_limit = 20000; |
| 5668 | 5672 |
| 5669 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, | 5673 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, |
| 5670 doc: /* Don't keep more than this much size of undo information. | 5674 doc: /* Don't keep more than this much size of undo information. |
| 5671 A command which pushes past this size is itself forgotten. | 5675 A previous command which pushes the undo list past this size |
| 5672 This limit is applied when garbage collection happens. | 5676 is entirely forgotten when GC happens. |
| 5673 The size is counted as the number of bytes occupied, | 5677 The size is counted as the number of bytes occupied, |
| 5674 which includes both saved text and other data. */); | 5678 which includes both saved text and other data. */); |
| 5675 undo_strong_limit = 30000; | 5679 undo_strong_limit = 30000; |
| 5680 | |
| 5681 DEFVAR_INT ("undo-outer-limit", &undo_outer_limit, | |
| 5682 doc: /* Don't keep more than this much size of undo information. | |
| 5683 If the current command has produced more than this much undo information, | |
| 5684 GC discards it. This is a last-ditch limit to prevent memory overflow. | |
| 5685 The size is counted as the number of bytes occupied, | |
| 5686 which includes both saved text and other data. */); | |
| 5687 undo_outer_limit = 300000; | |
| 5676 | 5688 |
| 5677 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, | 5689 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, |
| 5678 doc: /* Non-nil means display messages at start and end of garbage collection. */); | 5690 doc: /* Non-nil means display messages at start and end of garbage collection. */); |
| 5679 garbage_collection_messages = 0; | 5691 garbage_collection_messages = 0; |
| 5680 | 5692 |
