diff options
| author | Paul Eggert | 2019-03-01 09:01:59 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-03-01 09:09:47 -0800 |
| commit | 7e29eae023c8158d41eba02c2367e70cbee53642 (patch) | |
| tree | 6679f45eba3b0b06dfb8ba4353b259445b6c1340 /src/lisp.h | |
| parent | fb52d961a40d889d87628058be6ea8116ced2e13 (diff) | |
| download | emacs-7e29eae023c8158d41eba02c2367e70cbee53642.tar.gz emacs-7e29eae023c8158d41eba02c2367e70cbee53642.zip | |
Suppress GC stats when obviously not needed
This should help future improvements where these stats can be
bignums that do not fit into intmax_t.
* src/alloc.c (struct gcstat, gcstat): New type and static var,
to package up GC statistics into one C object. It replaces ...
(total_free_intervals, total_intervals, total_strings)
(total_free_strings, total_string_bytes, total_vectors)
(total_vector_slots, total_free_vector_slots): ... these
removed static vars. All uses changed.
(garbage_collect_1): Accept a struct gcstat *, not a void *
which was not used anymore anyway. Return a bool indicating
success, instead of a Lisp object. All callers changed.
(garbage_collect): New function. All C callers of
Fgarbage_collect changed to use it, since none of them use the
return value. Now, only Lisp code uses Fgarbage_collect.
(Fgarbage_collect): No longer noinline. Cons up the return
value here, not in garbage_collect_1.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index 388cd04163a..32576930b29 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3763,6 +3763,7 @@ extern void alloc_unexec_post (void); | |||
| 3763 | extern void mark_maybe_objects (Lisp_Object *, ptrdiff_t); | 3763 | extern void mark_maybe_objects (Lisp_Object *, ptrdiff_t); |
| 3764 | extern void mark_stack (char *, char *); | 3764 | extern void mark_stack (char *, char *); |
| 3765 | extern void flush_stack_call_func (void (*func) (void *arg), void *arg); | 3765 | extern void flush_stack_call_func (void (*func) (void *arg), void *arg); |
| 3766 | extern void garbage_collect (void); | ||
| 3766 | extern const char *pending_malloc_warning; | 3767 | extern const char *pending_malloc_warning; |
| 3767 | extern Lisp_Object zero_vector; | 3768 | extern Lisp_Object zero_vector; |
| 3768 | typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ | 3769 | typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ |
| @@ -5003,7 +5004,7 @@ maybe_gc (void) | |||
| 5003 | && consing_since_gc > gc_relative_threshold) | 5004 | && consing_since_gc > gc_relative_threshold) |
| 5004 | || (!NILP (Vmemory_full) | 5005 | || (!NILP (Vmemory_full) |
| 5005 | && consing_since_gc > memory_full_cons_threshold)) | 5006 | && consing_since_gc > memory_full_cons_threshold)) |
| 5006 | Fgarbage_collect (); | 5007 | garbage_collect (); |
| 5007 | } | 5008 | } |
| 5008 | 5009 | ||
| 5009 | INLINE_HEADER_END | 5010 | INLINE_HEADER_END |