]> git.eshelyaron.com Git - emacs.git/commitdiff
(gc_cons_threshold): Not static.
authorRichard M. Stallman <rms@gnu.org>
Sat, 23 Jul 2005 19:08:06 +0000 (19:08 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 23 Jul 2005 19:08:06 +0000 (19:08 +0000)
(gc_cons_combined_threshold): Var deleted.
(gc_relative_threshold): New variable.
(Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
instead of gc_cons_combined_threshold.

src/alloc.c

index a65a96f16313004eed5ffe20c134f5615eb6b0d6..3c9b2199e5239e2eb1348316a3c6fb8db67309be 100644 (file)
@@ -172,10 +172,14 @@ EMACS_INT misc_objects_consed;
 EMACS_INT intervals_consed;
 EMACS_INT strings_consed;
 
-/* Number of bytes of consing since GC before another GC should be done. */
+/* Minimum number of bytes of consing since GC before next GC. */
+
+EMACS_INT gc_cons_threshold;
+
+/* Similar minimum, computed from Vgc_cons_percentage.  */
+
+EMACS_INT gc_relative_threshold;
 
-static EMACS_INT gc_cons_threshold;
-EMACS_INT gc_cons_combined_threshold;
 static Lisp_Object Vgc_cons_percentage;
 
 /* Nonzero during GC.  */
@@ -4899,12 +4903,10 @@ returns nil, because real GC can't be done.  */)
   if (gc_cons_threshold < 10000)
     gc_cons_threshold = 10000;
 
-  gc_cons_combined_threshold = gc_cons_threshold;
-
   if (FLOATP (Vgc_cons_percentage))
     { /* Set gc_cons_combined_threshold.  */
       EMACS_INT total = 0;
-      EMACS_INT threshold;
+
       total += total_conses  * sizeof (struct Lisp_Cons);
       total += total_symbols * sizeof (struct Lisp_Symbol);
       total += total_markers * sizeof (union Lisp_Misc);
@@ -4914,10 +4916,10 @@ returns nil, because real GC can't be done.  */)
       total += total_intervals * sizeof (struct interval);
       total += total_strings * sizeof (struct Lisp_String);
       
-      threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
-      if (threshold > gc_cons_combined_threshold)
-       gc_cons_combined_threshold = threshold;
+      gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
     }
+  else
+    gc_relative_threshold = 0;
 
   if (garbage_collection_messages)
     {
@@ -6008,7 +6010,8 @@ init_alloc_once ()
   staticidx = 0;
   consing_since_gc = 0;
   gc_cons_threshold = 100000 * sizeof (Lisp_Object);
-  gc_cons_combined_threshold = gc_cons_threshold;
+  gc_relative_threshold = 0;
+
 #ifdef VIRT_ADDR_VARIES
   malloc_sbrk_unused = 1<<22;  /* A large number */
   malloc_sbrk_used = 100000;   /* as reasonable as any number */