diff options
author | Hans Boehm <Hans_Boehm@hp.com> | 2002-04-09 00:39:16 +0000 |
---|---|---|
committer | Hans Boehm <hboehm@gcc.gnu.org> | 2002-04-09 00:39:16 +0000 |
commit | 787bf7e377c15754ff9f0670dbeb037125faad7d (patch) | |
tree | 0f43ea46e4d334b0f5b6be281db4806e87434993 /boehm-gc/allchblk.c | |
parent | cc382e5c1af3b867867cde8f906ae9fbfc9ac105 (diff) | |
download | gcc-787bf7e377c15754ff9f0670dbeb037125faad7d.zip gcc-787bf7e377c15754ff9f0670dbeb037125faad7d.tar.gz gcc-787bf7e377c15754ff9f0670dbeb037125faad7d.tar.bz2 |
gc_priv.h (WARN macro): Add "GC warning:" prefix.
* 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.
From-SVN: r52053
Diffstat (limited to 'boehm-gc/allchblk.c')
-rw-r--r-- | boehm-gc/allchblk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c index 3da58c4..7d4cbd8 100644 --- a/boehm-gc/allchblk.c +++ b/boehm-gc/allchblk.c @@ -654,9 +654,13 @@ int n; && orig_avail - size_needed > (signed_word)BL_LIMIT) { /* Punt, since anything else risks unreasonable heap growth. */ - if (0 == GETENV("GC_NO_BLACKLIST_WARNING")) { - WARN("Needed to allocate blacklisted block at 0x%lx\n", - (word)hbp); + if (++GC_large_alloc_warn_suppressed + >= GC_large_alloc_warn_interval) { + WARN("Repeated allocation of very large block " + "(appr. size %ld):\n" + "\tMay lead to memory leak and poor performance.\n", + size_needed); + GC_large_alloc_warn_suppressed = 0; } size_avail = orig_avail; } else if (size_avail == 0 && size_needed == HBLKSIZE |