diff options
| author | Karoly Lorentey | 2004-05-31 13:48:26 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-05-31 13:48:26 +0000 |
| commit | 190a56d6e02f134591a9d8861b8c4aa55bbec79b (patch) | |
| tree | d1ea16845ca26efed987116be6e6b4fc6fc60000 /src/alloc.c | |
| parent | a596810c6c3c3c2fd450717f5083a5ff5207d243 (diff) | |
| parent | 64df673db44e48ae6e2f57849f42961a78103075 (diff) | |
| download | emacs-190a56d6e02f134591a9d8861b8c4aa55bbec79b.tar.gz emacs-190a56d6e02f134591a9d8861b8c4aa55bbec79b.zip | |
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
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index adedb414aad..3a3628f40fd 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -155,6 +155,7 @@ int malloc_sbrk_unused; | |||
| 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 | ||
| @@ -755,17 +756,20 @@ lisp_align_malloc (nbytes, type) | |||
| 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) |
| @@ -4381,7 +4385,7 @@ returns nil, because real GC can't be done. */) | |||
| 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)) |
| @@ -5668,12 +5672,20 @@ which includes both saved text and other data. */); | |||
| 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; |
| 5676 | 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; | ||
| 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; |