summaryrefslogtreecommitdiff
path: root/cachegrind
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-08-11 00:47:10 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-08-11 00:47:10 +0000
commit4bd67b50448a7b826a34f8f8977d88ece0f6cac7 (patch)
treead0e9c777c394b85d29a2cba8138b750bd1c54e2 /cachegrind
parent34582fb5d483f8f0c426ad24f81bb758400bf3da (diff)
Get rid of some stupidity:
- Added some useful hash table functions (vanilla lookup() and remove()). [Actually, I accidentally added them with my previous commit] Replaced various simple uses of VG_(HT_get_node) with these new functions. - Passing record_freemismatch_error() the MAC_Chunk of the freed heap block. So now we don't need to call describe_addr() to re-find that block, which means that we can remove the MAC_Chunk from the malloc_list earlier, rather than having to do a lookup and then later remove it with the stupid removal handle returned by VG_(HT_get_node)(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4379 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r--cachegrind/cg_main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index e273cf86..159c5f88 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -358,10 +358,9 @@ void log_1I_2D_cache_access(instr_info* n, Addr data_addr1, Addr data_addr2)
static
BB_info* get_BB_info(IRBB* bbIn, Addr origAddr, Bool* bbSeenBefore)
{
- Int i, n_instrs;
- IRStmt* st;
- BB_info* bbInfo;
- VgHashNode** dummy;
+ Int i, n_instrs;
+ IRStmt* st;
+ BB_info* bbInfo;
// Count number of original instrs in BB
n_instrs = 0;
@@ -371,7 +370,7 @@ BB_info* get_BB_info(IRBB* bbIn, Addr origAddr, Bool* bbSeenBefore)
}
// Get the BB_info
- bbInfo = (BB_info*)VG_(HT_get_node)(instr_info_table, origAddr, &dummy);
+ bbInfo = (BB_info*)VG_(HT_lookup)(instr_info_table, origAddr);
*bbSeenBefore = ( NULL == bbInfo ? False : True );
if (*bbSeenBefore) {
// BB must have been translated before, but flushed from the TT
@@ -1078,15 +1077,13 @@ static void cg_fini(Int exitcode)
// Called when a translation is invalidated due to code unloading.
static void cg_discard_basic_block_info ( Addr a, SizeT size )
{
- VgHashNode** prev_next_ptr;
VgHashNode* bbInfo;
if (0) VG_(printf)( "discard_basic_block_info: %p, %llu\n", a, (ULong)size);
// Get BB info, remove from table, free BB info. Simple!
- bbInfo = VG_(HT_get_node)(instr_info_table, a, &prev_next_ptr);
+ bbInfo = VG_(HT_remove)(instr_info_table, a);
tl_assert(NULL != bbInfo);
- *prev_next_ptr = bbInfo->next;
VG_(free)(bbInfo);
}