diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c index 055f5d82347..0b80fd5d9e7 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 | ||
| @@ -4383,7 +4384,7 @@ returns nil, because real GC can't be done. */) | |||
| 4383 | if (! EQ (nextb->undo_list, Qt)) | 4384 | if (! EQ (nextb->undo_list, Qt)) |
| 4384 | nextb->undo_list | 4385 | nextb->undo_list |
| 4385 | = truncate_undo_list (nextb->undo_list, undo_limit, | 4386 | = truncate_undo_list (nextb->undo_list, undo_limit, |
| 4386 | undo_strong_limit); | 4387 | undo_strong_limit, undo_outer_limit); |
| 4387 | 4388 | ||
| 4388 | /* Shrink buffer gaps, but skip indirect and dead buffers. */ | 4389 | /* Shrink buffer gaps, but skip indirect and dead buffers. */ |
| 4389 | if (nextb->base_buffer == 0 && !NILP (nextb->name)) | 4390 | if (nextb->base_buffer == 0 && !NILP (nextb->name)) |
| @@ -5669,12 +5670,20 @@ which includes both saved text and other data. */); | |||
| 5669 | 5670 | ||
| 5670 | DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, | 5671 | DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, |
| 5671 | doc: /* Don't keep more than this much size of undo information. | 5672 | doc: /* Don't keep more than this much size of undo information. |
| 5672 | A command which pushes past this size is itself forgotten. | 5673 | A previous command which pushes the undo list past this size |
| 5673 | This limit is applied when garbage collection happens. | 5674 | is entirely forgotten when GC happens. |
| 5674 | The size is counted as the number of bytes occupied, | 5675 | The size is counted as the number of bytes occupied, |
| 5675 | which includes both saved text and other data. */); | 5676 | which includes both saved text and other data. */); |
| 5676 | undo_strong_limit = 30000; | 5677 | undo_strong_limit = 30000; |
| 5677 | 5678 | ||
| 5679 | DEFVAR_INT ("undo-outer-limit", &undo_outer_limit, | ||
| 5680 | doc: /* Don't keep more than this much size of undo information. | ||
| 5681 | If the current command has produced more than this much undo information, | ||
| 5682 | GC discards it. This is a last-ditch limit to prevent memory overflow. | ||
| 5683 | The size is counted as the number of bytes occupied, | ||
| 5684 | which includes both saved text and other data. */); | ||
| 5685 | undo_outer_limit = 300000; | ||
| 5686 | |||
| 5678 | DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, | 5687 | DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, |
| 5679 | doc: /* Non-nil means display messages at start and end of garbage collection. */); | 5688 | doc: /* Non-nil means display messages at start and end of garbage collection. */); |
| 5680 | garbage_collection_messages = 0; | 5689 | garbage_collection_messages = 0; |