|
From: <sv...@va...> - 2012-04-02 14:36:34
|
bart 2012-04-02 15:36:22 +0100 (Mon, 02 Apr 2012)
New Revision: 12478
Log:
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.
Modified files:
trunk/drd/drd_malloc_wrappers.c
Modified: trunk/drd/drd_malloc_wrappers.c (+2 -2)
===================================================================
--- trunk/drd/drd_malloc_wrappers.c 2012-04-02 15:26:30 +01:00 (rev 12477)
+++ trunk/drd/drd_malloc_wrappers.c 2012-04-02 15:36:22 +01:00 (rev 12478)
@@ -131,10 +131,10 @@
if (mc)
{
tl_assert(p == mc->data);
+ if (mc->size > 0)
+ s_stop_using_mem_callback(mc->data, mc->size);
if (dealloc)
VG_(cli_free)((void*)p);
- if (mc->size > 0)
- s_stop_using_mem_callback(mc->data, mc->size);
VG_(HT_remove)(s_malloc_list, (UWord)p);
VG_(free)(mc);
return True;
|