From: hboehm Date: Mon, 10 Nov 2008 23:15:32 +0000 (+0000) Subject: 2008-11-10 Hans Boehm (Really mostly Ivan Maidansky) X-Git-Tag: gc7_2alpha2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3dfd3158b5531b8852a3bfb3a73e12b196afdf13;p=gc 2008-11-10 Hans Boehm (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. --- diff --git a/ChangeLog b/ChangeLog index 8b934139..90ed1262 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-10 Hans Boehm (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 (Really Ivan Maidansky) (Mostly improves LLP64 support.) * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c, diff --git a/doc/README.environment b/doc/README.environment index d50d3709..adf7a193 100644 --- a/doc/README.environment +++ b/doc/README.environment @@ -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. diff --git a/include/gc.h b/include/gc.h index d8cac98b..77385e3f 100644 --- a/include/gc.h +++ b/include/gc.h @@ -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 8e7d3625..072902d9 100644 --- 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();