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
This commit is contained in:
Nicholas Nethercote 2005-03-13 14:28:39 +00:00
parent 1de264b8f7
commit 122ce0fcb5
3 changed files with 6 additions and 37 deletions

View 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

View 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 ---*/
/*--------------------------------------------------------------------*/

View 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. ---*/