From 7da1122b9bf4f0ab8da6958bca36c9bc0726564e Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Mon, 22 Jul 2019 04:09:29 +0000 Subject: [PATCH] Trigger GC earlier after garbage collection was inhibited * src/alloc.c (allow_garbage_collection): Don't ignore allocations that happen while garbage collection is inhibited. (garbage_collect_1): use `inhibit-garbage-collection'. --- src/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index aa9200f2eb..a32302f6e2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5507,7 +5507,7 @@ staticpro (Lisp_Object const *varaddress) static void allow_garbage_collection (intmax_t consing) { - consing_until_gc = consing; + consing_until_gc += consing - OBJECT_CT_MAX; garbage_collection_inhibited--; } @@ -5823,7 +5823,7 @@ garbage_collect_1 (struct gcstat *gcst) /* In case user calls debug_print during GC, don't let that cause a recursive GC. */ - consing_until_gc = OBJECT_CT_MAX; + inhibit_garbage_collection (); /* Save what's currently displayed in the echo area. Don't do that if we are GC'ing because we've run out of memory, since -- 2.22.0