From: Nicholas Nethercote Date: Sun, 13 Mar 2005 14:28:39 +0000 (+0000) Subject: Remove dead function VG_(is_empty_arena)(). Also cleaned up the comment in X-Git-Tag: svn/VALGRIND_3_0_0~979 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=122ce0fcb5f37b650341cefc5713c623fbd2e409;p=thirdparty%2Fvalgrind.git Remove dead function VG_(is_empty_arena)(). Also cleaned up the comment in vg_demangler.c regarding its former use. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3339 --- diff --git a/coregrind/core.h b/coregrind/core.h index 89c6d45711..b506fca478 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -400,8 +400,6 @@ extern void VG_(sanity_check_malloc_all) ( void ); extern void VG_(print_all_arena_stats) ( void ); -extern Bool VG_(is_empty_arena) ( ArenaId aid ); - /* --------------------------------------------------------------------- Exports of vg_intercept.c diff --git a/coregrind/vg_demangle.c b/coregrind/vg_demangle.c index c79a81d58c..d0bccda3d8 100644 --- a/coregrind/vg_demangle.c +++ b/coregrind/vg_demangle.c @@ -61,19 +61,16 @@ void VG_(demangle) ( Char* orig, Char* result, Int result_size ) ADD_TO_RESULT(orig, VG_(strlen)(orig)); } - /* Check that the demangler isn't leaking. */ - /* 15 Feb 02: if this assertion fails, this is not a disaster. - Comment it out, and let me know. (jseward@acm.org). */ - // 9 Feb 05: it fails very occasionally, as reported in bug #87480. - // It's very rare, and not a disaster, so let it slide. - //vg_assert(VG_(is_empty_arena)(VG_AR_DEMANGLE)); - - /* VG_(show_all_arena_stats)(); */ + // 13 Mar 2005: We used to check here that the demangler wasn't leaking + // by calling the (now-removed) function VG_(is_empty_arena)(). But, + // very rarely (ie. I've heard of it twice in 3 years), the demangler + // does leak. But, we can't do much about it, and it's not a disaster, + // so we just let it slide without aborting or telling the user. VGP_POPCC(VgpDemangle); } /*--------------------------------------------------------------------*/ -/*--- end vg_demangle.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/vg_malloc2.c b/coregrind/vg_malloc2.c index f8b1cb62dd..62dfe496b3 100644 --- a/coregrind/vg_malloc2.c +++ b/coregrind/vg_malloc2.c @@ -829,32 +829,6 @@ void VG_(sanity_check_malloc_all) ( void ) sanity_check_malloc_arena ( i ); } -/* Really, this isn't the right place for this. Nevertheless: find - out if an arena is empty -- currently has no bytes on loan. This - is useful for checking for memory leaks (of valgrind, not the - client.) */ -Bool VG_(is_empty_arena) ( ArenaId aid ) -{ - Arena* a; - Superblock* sb; - Block* b; - SizeT b_bszB; - - ensure_mm_init(); - a = arenaId_to_ArenaP(aid); - for (sb = a->sblocks; sb != NULL; sb = sb->next) { - // If the superblock is empty, it should contain a single free - // block, of the right size. - b = (Block*)&sb->payload_bytes[0]; - b_bszB = get_bszB_lo(b); - if (is_inuse_bszB(b_bszB)) return False; - if (mk_plain_bszB(b_bszB) != sb->n_payload_bytes) return False; - // If we reach here, this block is not in use and is of the right - // size, so keep going around the loop... - } - return True; -} - /*------------------------------------------------------------*/ /*--- Creating and deleting blocks. ---*/