From: Julian Seward Date: Fri, 14 Nov 2014 10:13:49 +0000 (+0000) Subject: Implement missing heap-intercept function "dh_malloc_usable_size". X-Git-Tag: svn/VALGRIND_3_11_0~827 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=258b4a6bc97abe538eb36e50d69cb6b8d408c750;p=thirdparty%2Fvalgrind.git Implement missing heap-intercept function "dh_malloc_usable_size". git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14721 --- diff --git a/exp-dhat/dh_main.c b/exp-dhat/dh_main.c index 2730385581..471c3edc62 100644 --- a/exp-dhat/dh_main.c +++ b/exp-dhat/dh_main.c @@ -671,12 +671,11 @@ static void* dh_realloc ( ThreadId tid, void* p_old, SizeT new_szB ) 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 ---// //------------------------------------------------------------//