From: Ulrich Drepper Date: Thu, 20 Sep 2001 19:19:08 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2-2-5~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e21f7767e2746d212cfc0ae117db2d035beed18;p=thirdparty%2Fglibc.git Update. * malloc/memusage.c (me): Always use dlsym() to find the real implementations. --- diff --git a/ChangeLog b/ChangeLog index 5aa60ecf67b..0e1dcfe9b63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-09-20 Ulrich Drepper + * malloc/memusage.c (me): Always use dlsym() to find the real + implementations. + * malloc/memusage.sh: Make -n option actually do something. 2001-09-20 Andreas Jaeger diff --git a/malloc/memusage.c b/malloc/memusage.c index d619fb96fb1..19bb35f94ff 100644 --- a/malloc/memusage.c +++ b/malloc/memusage.c @@ -181,6 +181,13 @@ me (void) const char *env = getenv ("MEMUSAGE_PROG_NAME"); size_t prog_len = strlen (__progname); + initialized = -1; + mallocp = (void *(*) (size_t)) dlsym (RTLD_NEXT, "malloc"); + reallocp = (void *(*) (void *, size_t)) dlsym (RTLD_NEXT, "realloc"); + callocp = (void *(*) (size_t, size_t)) dlsym (RTLD_NEXT, "calloc"); + freep = (void (*) (void *)) dlsym (RTLD_NEXT, "free"); + initialized = 1; + if (env != NULL) { /* Check for program name. */ @@ -198,13 +205,6 @@ me (void) if (!start_sp) start_sp = GETSP (); - initialized = -1; - mallocp = (void *(*) (size_t)) dlsym (RTLD_NEXT, "malloc"); - reallocp = (void *(*) (void *, size_t)) dlsym (RTLD_NEXT, "realloc"); - callocp = (void *(*) (size_t, size_t)) dlsym (RTLD_NEXT, "calloc"); - freep = (void (*) (void *)) dlsym (RTLD_NEXT, "free"); - initialized = 1; - outname = getenv ("MEMUSAGE_OUTPUT"); if (outname != NULL && outname[0] != '\0' && (access (outname, R_OK | W_OK) == 0 || errno == ENOENT))