diff options
| author | Stefan Monnier | 2019-06-26 10:03:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-06-26 10:03:48 -0400 |
| commit | 698ff554ac2699ec48fefc85a1307cbc4a183b0d (patch) | |
| tree | a7b7592f7973f81cad4410366d313e790616907e /src | |
| parent | 9233865b7005831e63755eb84ae7da060f878a55 (diff) | |
| download | emacs-698ff554ac2699ec48fefc85a1307cbc4a183b0d.tar.gz emacs-698ff554ac2699ec48fefc85a1307cbc4a183b0d.zip | |
* lisp/calc/calc-ext.el (math-scalarp): Fix typo
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 23 | ||||
| -rw-r--r-- | src/keyboard.c | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index 64aaa8acdfa..86ecf5291c6 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5989,6 +5989,28 @@ garbage_collect (void) | |||
| 5989 | garbage_collect_1 (&gcst); | 5989 | garbage_collect_1 (&gcst); |
| 5990 | } | 5990 | } |
| 5991 | 5991 | ||
| 5992 | DEFUN ("garbage-collect-maybe", Fgarbage_collect_maybe, Sgarbage_collect_maybe, 1, 1, "", | ||
| 5993 | doc: /* Call `garbage-collect' if enough allocation happened. | ||
| 5994 | FACTOR determines what "enough" means here: | ||
| 5995 | a FACTOR of N means to run the GC if more than 1/Nth of the allocations | ||
| 5996 | needed 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 | |||
| 5992 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", | 6014 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", |
| 5993 | doc: /* Reclaim storage for Lisp objects no longer needed. | 6015 | doc: /* Reclaim storage for Lisp objects no longer needed. |
| 5994 | Garbage collection happens automatically if you cons more than | 6016 | Garbage collection happens automatically if you cons more than |
| @@ -7389,6 +7411,7 @@ N should be nonnegative. */); | |||
| 7389 | defsubr (&Smake_finalizer); | 7411 | defsubr (&Smake_finalizer); |
| 7390 | defsubr (&Spurecopy); | 7412 | defsubr (&Spurecopy); |
| 7391 | defsubr (&Sgarbage_collect); | 7413 | defsubr (&Sgarbage_collect); |
| 7414 | defsubr (&Sgarbage_collect_maybe); | ||
| 7392 | defsubr (&Smemory_info); | 7415 | defsubr (&Smemory_info); |
| 7393 | defsubr (&Smemory_use_counts); | 7416 | defsubr (&Smemory_use_counts); |
| 7394 | defsubr (&Ssuspicious_object); | 7417 | defsubr (&Ssuspicious_object); |
diff --git a/src/keyboard.c b/src/keyboard.c index 56916e0cb4e..9e1567f8cfe 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 (); | 2731 | maybe_gc (); /* FIXME: Why? */ |
| 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 |