mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-24 14:41:06 +08:00
Update.
* malloc/memusage.c (me): Always use dlsym() to find the real implementations.
This commit is contained in:
parent
f4cc201ee1
commit
0e21f7767e
@ -1,5 +1,8 @@
|
|||||||
2001-09-20 Ulrich Drepper <drepper@redhat.com>
|
2001-09-20 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* malloc/memusage.c (me): Always use dlsym() to find the real
|
||||||
|
implementations.
|
||||||
|
|
||||||
* malloc/memusage.sh: Make -n option actually do something.
|
* malloc/memusage.sh: Make -n option actually do something.
|
||||||
|
|
||||||
2001-09-20 Andreas Jaeger <aj@suse.de>
|
2001-09-20 Andreas Jaeger <aj@suse.de>
|
||||||
|
@ -181,6 +181,13 @@ me (void)
|
|||||||
const char *env = getenv ("MEMUSAGE_PROG_NAME");
|
const char *env = getenv ("MEMUSAGE_PROG_NAME");
|
||||||
size_t prog_len = strlen (__progname);
|
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)
|
if (env != NULL)
|
||||||
{
|
{
|
||||||
/* Check for program name. */
|
/* Check for program name. */
|
||||||
@ -198,13 +205,6 @@ me (void)
|
|||||||
if (!start_sp)
|
if (!start_sp)
|
||||||
start_sp = GETSP ();
|
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");
|
outname = getenv ("MEMUSAGE_OUTPUT");
|
||||||
if (outname != NULL && outname[0] != '\0'
|
if (outname != NULL && outname[0] != '\0'
|
||||||
&& (access (outname, R_OK | W_OK) == 0 || errno == ENOENT))
|
&& (access (outname, R_OK | W_OK) == 0 || errno == ENOENT))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user