aboutsummaryrefslogtreecommitdiff
path: root/malloc/memusage.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-20 19:19:08 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-20 19:19:08 +0000
commit0e21f7767e2746d212cfc0ae117db2d035beed18 (patch)
tree33f974f0e87a74c3f41cc64f6ecda858be224759 /malloc/memusage.c
parentf4cc201ee1f54231e3e9e3c6268e29f1ed14994b (diff)
downloadglibc-0e21f7767e2746d212cfc0ae117db2d035beed18.zip
glibc-0e21f7767e2746d212cfc0ae117db2d035beed18.tar.gz
glibc-0e21f7767e2746d212cfc0ae117db2d035beed18.tar.bz2
Update.
* malloc/memusage.c (me): Always use dlsym() to find the real implementations.
Diffstat (limited to 'malloc/memusage.c')
-rw-r--r--malloc/memusage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/malloc/memusage.c b/malloc/memusage.c
index d619fb9..19bb35f 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))