]> granicus.if.org Git - gc/commitdiff
2008-11-10 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
authorhboehm <hboehm>
Mon, 10 Nov 2008 23:15:32 +0000 (23:15 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:44 +0000 (21:06 +0400)
* misc.c, doc/README.environment: Add support  for
GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
* include/gc.h: Make GC_set_free_space_divisor correspond to
(somewhat unfortunate) reality.

ChangeLog
doc/README.environment
include/gc.h
misc.c

index 8b934139ecc9d184ea675f62e7c4f6781a57fdba..90ed1262f544b337fc9c9fe3407b32f3301f4872 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
+       * misc.c, doc/README.environment: Add support  for
+       GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
+       * include/gc.h: Make GC_set_free_space_divisor correspond to
+       (somewhat unfortunate) reality.
+
 2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
        (Mostly improves LLP64 support.)
        * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
index d50d37094c79ceedeb62db891375607d5fd4cc0f..adf7a193a1e04dddb99e80219b4a3da715be989f 100644 (file)
@@ -94,6 +94,9 @@ GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
                     was turned into a runtime flag to enable last-minute
                     work-arounds.
 
+GC_DISABLE_INCREMENTAL - Ignore runtime requests to enable incremental GC.
+                    Useful for debugging.
+
 The following turn on runtime flags that are also program settable.  Checked
 only during initialization.  We expect that they will usually be set through
 other means, but this may help with debugging and testing:
@@ -118,6 +121,10 @@ GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.
                     run on a multiprocessor, incremental collection should
                     only be used with unlimited pause time.
 
+GC_FREE_SPACE_DIVISOR - Set GC_free_space_divisor to the indicated value.
+                      Setting it to larger values decreases space consumption
+                     and increases GC frequency.
+
 GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.  Forces a
               collection at program termination to detect leaks that would
               otherwise occur after the last GC.
@@ -129,7 +136,7 @@ GC_DONT_GC - Turns off garbage collection.  Use cautiously.
 
 GC_TRACE=addr - Intended for collector debugging.  Requires that the collector
                have been built with ENABLE_TRACE defined.  Causes the debugger
-               to log information about the tracing of address ranges containing
-               addr.  Typically addr is the address that contains a pointer to
-               an object that mysteriously failed to get marked.  Addr must be
-               specified as a hexadecimal integer.
+               to log information about the tracing of address ranges
+               containing addr.  Typically addr is the address that contains
+               a pointer to an object that mysteriously failed to get marked.
+               Addr must be specified as a hexadecimal integer.
index d8cac98b2d72024ff6fc5254ee0165ba3bc86ae3..77385e3f68bd830bac9722edbcb06753a440237f 100644 (file)
@@ -837,7 +837,7 @@ GC_API GC_warn_proc GC_CALL GC_set_warn_proc(GC_warn_proc p);
 GC_API GC_word GC_CALL GC_set_free_space_divisor(GC_word value);
     /* Set free_space_divisor.  See above for definition.      */
     /* Returns old value.                                      */
-    /* With zero argument, nothing is changed, but old value is        */
+    /* With -1 argument, nothing is changed, but old value is  */
     /* returned.  (Only true for GC7.2+)                       */
        
 /* The following is intended to be used by a higher level      */
diff --git a/misc.c b/misc.c
index 8e7d3625c5755e3425b56b45e4eac5c533e74366..072902d9f22f1e8a41d163b58006548602618834 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -589,6 +589,14 @@ void GC_init_inner(void)
         }
       }
     }
+    {
+       char * space_divisor_string = GETENV("GC_FREE_SPACE_DIVISOR");
+       if (space_divisor_string != NULL) {
+         int space_divisor = atoi(space_divisor_string);
+         if (space_divisor > 0)
+           GC_free_space_divisor = (GC_word)space_divisor;
+       }
+    }
     maybe_install_looping_handler();
     /* Adjust normal object descriptor for extra allocation.   */
     if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) {
@@ -770,7 +778,7 @@ GC_API void GC_CALL GC_enable_incremental(void)
   /* If we are keeping back pointers, the GC itself dirties all        */
   /* pages on which objects have been marked, making           */
   /* incremental GC pointless.                                 */
-  if (!GC_find_leak) {
+  if (!GC_find_leak && 0 == GETENV("GC_DISABLE_INCREMENTAL")) {
     DCL_LOCK_STATE;
     
     LOCK();