]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge, from trunk, r14721
authorJulian Seward <jseward@acm.org>
Sun, 23 Nov 2014 18:02:46 +0000 (18:02 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 23 Nov 2014 18:02:46 +0000 (18:02 +0000)
14721  Implement missing heap-intercept function "dh_malloc_usable_size".

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_10_BRANCH@14770

exp-dhat/dh_main.c

index 4142a90522605afe745fe198dfce3ae5acfc291a..cf899d92c81abc2b67e341ea435d1293d39f674b 100644 (file)
@@ -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                                    ---//
 //------------------------------------------------------------//