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/allchblk.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/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 3da58c4ca0c..7d4cbd82f13 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 |