diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 23 |
1 files changed, 0 insertions, 23 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 | ||
| 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 | |||
| 6014 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", | 5992 | DEFUN ("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. |
| 6016 | Garbage collection happens automatically if you cons more than | 5994 | Garbage 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); |