diff options
author | hboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-09 00:39:16 +0000 |
---|---|---|
committer | hboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-09 00:39:16 +0000 |
commit | fea37d3ec4d8bc865b42ec270848967dfe988a1f (patch) | |
tree | 0f43ea46e4d334b0f5b6be281db4806e87434993 /boehm-gc/misc.c | |
parent | 00f87a508bee43a1e362830a424e045da1e6cfd4 (diff) | |
download | gcc-fea37d3ec4d8bc865b42ec270848967dfe988a1f.tar.gz |
* include/private/gc_priv.h (WARN macro): Add "GC warning:" prefix.
(GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed):
declare.
* allchblk.c (GC_allchblk_nth): Change text and support reduced
frequency for blacklist warning message.
* misc.c (GC_large_alloc_warn_interval,
GC_large_alloc_warn_suppressed): define.
(GC_init_inner): Check GC_NO_BLACKLIST_WARNING and
GC_LARGE_ALLOC_WARN_INTERVAL environment variables.
* doc/README.environment (GC_NO_BLACKLIST_WARNING): Deprecate.
(GC_LARGE_ALLOC_WARN_INTERVAL): Add documentation.
* dyn_load.c (_DYNAMIC): Move declaration to file scope.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/misc.c')
-rw-r--r-- | boehm-gc/misc.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c index 50955f458cc..f6079732fbf 100644 --- a/boehm-gc/misc.c +++ b/boehm-gc/misc.c @@ -16,6 +16,7 @@ #include <stdio.h> +#include <limits.h> #ifndef _WIN32_WCE #include <signal.h> #endif @@ -112,6 +113,12 @@ GC_bool GC_print_back_height = 0; int GC_all_interior_pointers = 0; #endif +long GC_large_alloc_warn_interval = 5; + /* Interval between unsuppressed warnings. */ + +long GC_large_alloc_warn_suppressed = 0; + /* Number of warnings suppressed so far. */ + /*ARGSUSED*/ GC_PTR GC_default_oom_fn GC_PROTO((size_t bytes_requested)) { @@ -518,11 +525,13 @@ void GC_init_inner() if (0 != GETENV("GC_PRINT_BACK_HEIGHT")) { GC_print_back_height = 1; } + if (0 != GETENV("GC_NO_BLACKLIST_WARNING")) { + GC_large_alloc_warn_interval = LONG_MAX; + } { char * time_limit_string = GETENV("GC_PAUSE_TIME_TARGET"); if (0 != time_limit_string) { - long time_limit; - if (time_limit_string != 0) time_limit = atol(time_limit_string); + long time_limit = atol(time_limit_string); if (time_limit < 5) { WARN("GC_PAUSE_TIME_TARGET environment variable value too small " "or bad syntax: Ignoring\n", 0); @@ -531,6 +540,18 @@ void GC_init_inner() } } } + { + char * interval_string = GETENV("GC_LARGE_ALLOC_WARN_INTERVAL"); + if (0 != interval_string) { + long interval = atol(interval_string); + if (interval <= 0) { + WARN("GC_LARGE_ALLOC_WARN_INTERVAL environment variable has " + "bad value: Ignoring\n", 0); + } else { + GC_large_alloc_warn_interval = interval; + } + } + } # ifdef UNIX_LIKE if (0 != GETENV("GC_LOOP_ON_ABORT")) { GC_set_and_save_fault_handler(looping_handler); |