| diff -aruN a/CFBase.c b/CFBase.c |
| --- a/CFBase.c 2011-08-10 16:29:04.841083602 -0700 |
| +++ b/CFBase.c 2011-08-10 15:46:44.000000000 -0700 |
| @@ -44,6 +44,7 @@ |
| #include <mach/mach.h> |
| #include <dlfcn.h> |
| #elif DEPLOYMENT_TARGET_LINUX |
| +#include <mcheck.h> |
| #include <pthread.h> |
| #elif DEPLOYMENT_TARGET_WINDOWS |
| #include <windows.h> |
| @@ -281,6 +282,14 @@ |
| } |
| |
| static void __CFAllocatorSystemDeallocate(void *ptr, void *info) { |
| +#if defined(DEBUG) |
| + const enum mcheck_status status = mprobe(ptr); |
| + |
| + CFAssert3(status == MCHECK_OK || status == MCHECK_DISABLED, |
| + __kCFLogAssertion, "%s: ptr %p status %d", |
| + __PRETTY_FUNCTION__, ptr, status); |
| +#endif |
| + |
| free(ptr); |
| } |
| #endif |