aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 7bed3f4488d..14b0a7b8381 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -224,7 +224,7 @@ struct emacs_globals globals;
224 224
225/* maybe_gc collects garbage if this goes negative. */ 225/* maybe_gc collects garbage if this goes negative. */
226 226
227consing_ct consing_until_gc; 227intmax_t consing_until_gc;
228 228
229#ifdef HAVE_PDUMPER 229#ifdef HAVE_PDUMPER
230/* Number of finalizers run: used to loop over GC until we stop 230/* Number of finalizers run: used to loop over GC until we stop
@@ -2547,7 +2547,7 @@ free_cons (struct Lisp_Cons *ptr)
2547 might incorrectly return non-zero. */ 2547 might incorrectly return non-zero. */
2548 int incr = sizeof *ptr; 2548 int incr = sizeof *ptr;
2549 if (INT_ADD_WRAPV (consing_until_gc, incr, &consing_until_gc)) 2549 if (INT_ADD_WRAPV (consing_until_gc, incr, &consing_until_gc))
2550 consing_until_gc = CONSING_CT_MAX; 2550 consing_until_gc = INTMAX_MAX;
2551 gcstat.total_free_conses++; 2551 gcstat.total_free_conses++;
2552} 2552}
2553 2553
@@ -5502,7 +5502,7 @@ staticpro (Lisp_Object const *varaddress)
5502static void 5502static void
5503allow_garbage_collection (intmax_t consing) 5503allow_garbage_collection (intmax_t consing)
5504{ 5504{
5505 consing_until_gc = consing - (CONSING_CT_MAX - consing_until_gc); 5505 consing_until_gc = consing - (INTMAX_MAX - consing_until_gc);
5506 garbage_collection_inhibited--; 5506 garbage_collection_inhibited--;
5507} 5507}
5508 5508
@@ -5512,7 +5512,7 @@ inhibit_garbage_collection (void)
5512 ptrdiff_t count = SPECPDL_INDEX (); 5512 ptrdiff_t count = SPECPDL_INDEX ();
5513 record_unwind_protect_intmax (allow_garbage_collection, consing_until_gc); 5513 record_unwind_protect_intmax (allow_garbage_collection, consing_until_gc);
5514 garbage_collection_inhibited++; 5514 garbage_collection_inhibited++;
5515 consing_until_gc = CONSING_CT_MAX; 5515 consing_until_gc = INTMAX_MAX;
5516 return count; 5516 return count;
5517} 5517}
5518 5518
@@ -5818,7 +5818,7 @@ garbage_collect_1 (struct gcstat *gcst)
5818 5818
5819 /* In case user calls debug_print during GC, 5819 /* In case user calls debug_print during GC,
5820 don't let that cause a recursive GC. */ 5820 don't let that cause a recursive GC. */
5821 consing_until_gc = CONSING_CT_MAX; 5821 consing_until_gc = INTMAX_MAX;
5822 5822
5823 /* Save what's currently displayed in the echo area. Don't do that 5823 /* Save what's currently displayed in the echo area. Don't do that
5824 if we are GC'ing because we've run out of memory, since 5824 if we are GC'ing because we've run out of memory, since
@@ -5933,17 +5933,17 @@ garbage_collect_1 (struct gcstat *gcst)
5933 consing_until_gc = memory_full_cons_threshold; 5933 consing_until_gc = memory_full_cons_threshold;
5934 else 5934 else
5935 { 5935 {
5936 consing_ct threshold = max (gc_cons_threshold, GC_DEFAULT_THRESHOLD / 10); 5936 intmax_t threshold = max (gc_cons_threshold, GC_DEFAULT_THRESHOLD / 10);
5937 if (FLOATP (Vgc_cons_percentage)) 5937 if (FLOATP (Vgc_cons_percentage))
5938 { 5938 {
5939 double tot = (XFLOAT_DATA (Vgc_cons_percentage) 5939 double tot = (XFLOAT_DATA (Vgc_cons_percentage)
5940 * total_bytes_of_live_objects ()); 5940 * total_bytes_of_live_objects ());
5941 if (threshold < tot) 5941 if (threshold < tot)
5942 { 5942 {
5943 if (tot < CONSING_CT_MAX) 5943 if (tot < INTMAX_MAX)
5944 threshold = tot; 5944 threshold = tot;
5945 else 5945 else
5946 threshold = CONSING_CT_MAX; 5946 threshold = INTMAX_MAX;
5947 } 5947 }
5948 } 5948 }
5949 consing_until_gc = threshold; 5949 consing_until_gc = threshold;