Commit 7e29eae0 authored by Paul Eggert's avatar Paul Eggert

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.
parent fb52d961
Pipeline #888 failed with stage
in 57 minutes and 25 seconds
......@@ -1107,6 +1107,9 @@ scan_c_stream (FILE *infile)
g->flags |= DEFUN_noreturn;
if (strstr (input_buffer, "const"))
g->flags |= DEFUN_const;
/* Although the noinline attribute is no longer used,
leave its support in, in case it's needed later. */
if (strstr (input_buffer, "noinline"))
g->flags |= DEFUN_noinline;
}
......
This diff is collapsed.
......@@ -3763,6 +3763,7 @@ extern void alloc_unexec_post (void);
extern void mark_maybe_objects (Lisp_Object *, ptrdiff_t);
extern void mark_stack (char *, char *);
extern void flush_stack_call_func (void (*func) (void *arg), void *arg);
extern void garbage_collect (void);
extern const char *pending_malloc_warning;
extern Lisp_Object zero_vector;
typedef uintptr_t byte_ct; /* System byte counts reported by GC. */
......@@ -5003,7 +5004,7 @@ maybe_gc (void)
&& consing_since_gc > gc_relative_threshold)
|| (!NILP (Vmemory_full)
&& consing_since_gc > memory_full_cons_threshold))
Fgarbage_collect ();
garbage_collect ();
}
INLINE_HEADER_END
......
......@@ -4055,7 +4055,7 @@ types. */)
/* Clear out any detritus in memory. */
do {
number_finalizers_run = 0;
Fgarbage_collect ();
garbage_collect ();
} while (number_finalizers_run);
ptrdiff_t count = SPECPDL_INDEX ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment