|
From: <sv...@va...> - 2014-11-23 18:02:53
|
Author: sewardj
Date: Sun Nov 23 18:02:46 2014
New Revision: 14770
Log:
Merge, from trunk, r14721
14721 Implement missing heap-intercept function "dh_malloc_usable_size".
Modified:
branches/VALGRIND_3_10_BRANCH/ (props changed)
branches/VALGRIND_3_10_BRANCH/exp-dhat/dh_main.c
Modified: branches/VALGRIND_3_10_BRANCH/exp-dhat/dh_main.c
==============================================================================
--- branches/VALGRIND_3_10_BRANCH/exp-dhat/dh_main.c (original)
+++ branches/VALGRIND_3_10_BRANCH/exp-dhat/dh_main.c Sun Nov 23 18:02:46 2014
@@ -671,12 +671,11 @@
static SizeT dh_malloc_usable_size ( ThreadId tid, void* p )
{
- tl_assert(0);
-//zz HP_Chunk* hc = VG_(HT_lookup)( malloc_list, (UWord)p );
-//zz
-//zz return ( hc ? hc->req_szB + hc->slop_szB : 0 );
+ Block* bk = find_Block_containing( (Addr)p );
+ return bk ? bk->req_szB : 0;
}
+
//------------------------------------------------------------//
//--- memory references ---//
//------------------------------------------------------------//
|