]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove dead function VG_(is_empty_arena)(). Also cleaned up the comment in
authorNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 14:28:39 +0000 (14:28 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 14:28:39 +0000 (14:28 +0000)
vg_demangler.c regarding its former use.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3339

coregrind/core.h
coregrind/vg_demangle.c
coregrind/vg_malloc2.c

index 89c6d45711bb1ff09ea55b99ca08b254cc55c0da..b506fca4783240fe15524e3cea259827d756f680 100644 (file)
@@ -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
index c79a81d58c31146618d0b752c51a73a08e2a1268..d0bccda3d81315dfe00422ba91f7d09afa149ea3 100644 (file)
@@ -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                                                          ---*/
 /*--------------------------------------------------------------------*/
index f8b1cb62dd9e730c4a66d679439079fa5bbb851e..62dfe496b3b693ff95d60d492e8352848e392be7 100644 (file)
@@ -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.                        ---*/