aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c22
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
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
@@ -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.
5671A command which pushes past this size is itself forgotten. 5675A previous command which pushes the undo list past this size
5672This limit is applied when garbage collection happens. 5676is entirely forgotten when GC happens.
5673The size is counted as the number of bytes occupied, 5677The size is counted as the number of bytes occupied,
5674which includes both saved text and other data. */); 5678which 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.
5683If the current command has produced more than this much undo information,
5684GC discards it. This is a last-ditch limit to prevent memory overflow.
5685The size is counted as the number of bytes occupied,
5686which 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;