Skip to content

Commit 7d7c0cb

Browse files
author
sewardj
committed
Implement missing heap-intercept function "dh_malloc_usable_size".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14721 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 parent 5f25324 commit 7d7c0cb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

exp-dhat/dh_main.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -671,12 +671,11 @@ static void* dh_realloc ( ThreadId tid, void* p_old, SizeT new_szB )
671671

672672
static SizeT dh_malloc_usable_size ( ThreadId tid, void* p )
673673
{
674-
tl_assert(0);
675-
//zz HP_Chunk* hc = VG_(HT_lookup)( malloc_list, (UWord)p );
676-
//zz
677-
//zz return ( hc ? hc->req_szB + hc->slop_szB : 0 );
674+
Block* bk = find_Block_containing( (Addr)p );
675+
return bk ? bk->req_szB : 0;
678676
}
679677

678+
680679
//------------------------------------------------------------//
681680
//--- memory references ---//
682681
//------------------------------------------------------------//

0 commit comments

Comments
 (0)