aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorRichard M. Stallman2004-05-29 16:19:41 +0000
committerRichard M. Stallman2004-05-29 16:19:41 +0000
commitae6a9bfec95d147fc83251951b2f51acb294714b (patch)
tree478b3748580e9c2fd964913113d54efc63c48a70 /src/alloc.c
parent924ee4e288a518a66a7cbd36d91a391b359ca50d (diff)
downloademacs-ae6a9bfec95d147fc83251951b2f51acb294714b.tar.gz
emacs-ae6a9bfec95d147fc83251951b2f51acb294714b.zip
(undo_outer_limit): New variable.
(syms_of_alloc): Defvar it. (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c15
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
156EMACS_INT undo_limit; 156EMACS_INT undo_limit;
157EMACS_INT undo_strong_limit; 157EMACS_INT undo_strong_limit;
158EMACS_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.
5672A command which pushes past this size is itself forgotten. 5673A previous command which pushes the undo list past this size
5673This limit is applied when garbage collection happens. 5674is entirely forgotten when GC happens.
5674The size is counted as the number of bytes occupied, 5675The size is counted as the number of bytes occupied,
5675which includes both saved text and other data. */); 5676which 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.
5681If the current command has produced more than this much undo information,
5682GC discards it. This is a last-ditch limit to prevent memory overflow.
5683The size is counted as the number of bytes occupied,
5684which 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;