[memprof: 49/76] lib/memintercept.c: Do not use the __libc_malloc, calloc, realloc



commit 79983425cf0c7e122c53ad9bcaf0eff92f0c3180
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Mon Oct 26 12:47:25 2009 +0100

    lib/memintercept.c: Do not use the __libc_malloc, calloc, realloc
    
    The application might use a different malloc implementation and
    we should call this one instead of falling back to the glibc version.
    
    Currently __libc_ calls will go through the custom allocator as well
    and the strategy here is to wait for error reports and then change
    the do_malloc/do_free calls and really call the glibc version for
    these routines too.
    
    * lib/memintercept.c:
    (mi_init): Use malloc/calloc/memalign/realloc directly

 lib/memintercept.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/lib/memintercept.c b/lib/memintercept.c
index 97595ee..3a0266b 100644
--- a/lib/memintercept.c
+++ b/lib/memintercept.c
@@ -218,11 +218,11 @@ free (void *ptr)
 void
 mi_init (void)
 {
-	old_malloc = dlsym(RTLD_NEXT, "__libc_malloc");
-	old_realloc = dlsym(RTLD_NEXT, "__libc_realloc");
-	old_free = dlsym(RTLD_NEXT, "__libc_free");
-	old_calloc = dlsym(RTLD_NEXT, "__libc_calloc");
-	old_memalign = dlsym(RTLD_NEXT, "__libc_memalign");
+	old_malloc = dlsym(RTLD_NEXT, "malloc");
+	old_realloc = dlsym(RTLD_NEXT, "realloc");
+	old_free = dlsym(RTLD_NEXT, "free");
+	old_calloc = dlsym(RTLD_NEXT, "calloc");
+	old_memalign = dlsym(RTLD_NEXT, "memalign");
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]