aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c23
-rw-r--r--src/keyboard.c2
2 files changed, 1 insertions, 24 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 86ecf5291c6..64aaa8acdfa 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5989,28 +5989,6 @@ garbage_collect (void)
5989 garbage_collect_1 (&gcst); 5989 garbage_collect_1 (&gcst);
5990} 5990}
5991 5991
5992DEFUN ("garbage-collect-maybe", Fgarbage_collect_maybe, Sgarbage_collect_maybe, 1, 1, "",
5993 doc: /* Call `garbage-collect' if enough allocation happened.
5994FACTOR determines what "enough" means here:
5995a FACTOR of N means to run the GC if more than 1/Nth of the allocations
5996needed to triger automatic allocation took place. */)
5997 (Lisp_Object factor)
5998{
5999 CHECK_FIXNAT (factor);
6000 EMACS_INT fact = XFIXNAT (factor);
6001 byte_ct new_csgc = consing_since_gc * fact;
6002 if (new_csgc / fact != consing_since_gc)
6003 /* Overflow! */
6004 garbage_collect ();
6005 else
6006 {
6007 consing_since_gc = new_csgc;
6008 maybe_gc ();
6009 consing_since_gc /= fact;
6010 }
6011 return Qnil;
6012}
6013
6014DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", 5992DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
6015 doc: /* Reclaim storage for Lisp objects no longer needed. 5993 doc: /* Reclaim storage for Lisp objects no longer needed.
6016Garbage collection happens automatically if you cons more than 5994Garbage collection happens automatically if you cons more than
@@ -7411,7 +7389,6 @@ N should be nonnegative. */);
7411 defsubr (&Smake_finalizer); 7389 defsubr (&Smake_finalizer);
7412 defsubr (&Spurecopy); 7390 defsubr (&Spurecopy);
7413 defsubr (&Sgarbage_collect); 7391 defsubr (&Sgarbage_collect);
7414 defsubr (&Sgarbage_collect_maybe);
7415 defsubr (&Smemory_info); 7392 defsubr (&Smemory_info);
7416 defsubr (&Smemory_use_counts); 7393 defsubr (&Smemory_use_counts);
7417 defsubr (&Ssuspicious_object); 7394 defsubr (&Ssuspicious_object);
diff --git a/src/keyboard.c b/src/keyboard.c
index 9e1567f8cfe..56916e0cb4e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2728,7 +2728,7 @@ read_char (int commandflag, Lisp_Object map,
2728 2728
2729 /* If there is still no input available, ask for GC. */ 2729 /* If there is still no input available, ask for GC. */
2730 if (!detect_input_pending_run_timers (0)) 2730 if (!detect_input_pending_run_timers (0))
2731 maybe_gc (); /* FIXME: Why? */ 2731 maybe_gc ();
2732 } 2732 }
2733 2733
2734 /* Notify the caller if an autosave hook, or a timer, sentinel or 2734 /* Notify the caller if an autosave hook, or a timer, sentinel or