Modularised the malloc/free stuff into two modules: m_mallocfree for the
malloc/free implementation, and m_replacemalloc with the stuff for the tools
that replace malloc with their own version. Previously these two areas of
functionality were mixed up somewhat.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3648 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index 547c5a9..e169250 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -2156,7 +2156,7 @@
MAC_Chunk *m = (MAC_Chunk*)sh_ch;
Addr a = *(Addr*)ap;
- return VG_(addr_is_in_block)(a, m->data, m->size);
+ return VG_(addr_is_in_block)(a, m->data, m->size, MAC_MALLOC_REDZONE_SZB);
}
static Bool client_perm_maybe_describe( Addr a, AddrInfo* ai )
@@ -2168,7 +2168,8 @@
for (i = 0; i < cgb_used; i++) {
if (cgbs[i].start == 0 && cgbs[i].size == 0)
continue;
- if (VG_(addr_is_in_block)(a, cgbs[i].start, cgbs[i].size)) {
+ // Use zero as the redzone for client blocks.
+ if (VG_(addr_is_in_block)(a, cgbs[i].start, cgbs[i].size, 0)) {
MAC_Mempool **d, *mp;
/* OK - maybe it's a mempool, too? */