From 7a443761bcb985f6cb47cd1cfd74e3043c12b9a3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 2 Apr 2012 14:36:22 +0000 Subject: [PATCH] drd, free() intercept: Swap freeing and cleaning memory. Note: since the big lock is held while the malloc() and free() intercepts are running, and since mmap() is treated by Valgrind as a non-blocking system call, this code change is not expected to result in a behavior change of drd. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12478 --- drd/drd_malloc_wrappers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c index 6eaa6746b8..92e14d7e1f 100644 --- a/drd/drd_malloc_wrappers.c +++ b/drd/drd_malloc_wrappers.c @@ -131,10 +131,10 @@ Bool DRD_(freelike_block)(const ThreadId tid, const Addr p, const Bool dealloc) if (mc) { tl_assert(p == mc->data); - if (dealloc) - VG_(cli_free)((void*)p); if (mc->size > 0) s_stop_using_mem_callback(mc->data, mc->size); + if (dealloc) + VG_(cli_free)((void*)p); VG_(HT_remove)(s_malloc_list, (UWord)p); VG_(free)(mc); return True; -- 2.47.2