From: Ulrich Drepper Date: Tue, 22 Feb 2000 04:48:48 +0000 (+0000) Subject: (vALLOc): Call ptmalloc_init before mEMALIGn call to initialize X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53264a9e477fb3a8677b560baff780cada6b37c;p=thirdparty%2Fglibc.git (vALLOc): Call ptmalloc_init before mEMALIGn call to initialize malloc_getpagesize. (pvALLOc): Likewise. --- diff --git a/malloc/malloc.c b/malloc/malloc.c index 9f564adb638..645bcbe2dd4 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1,5 +1,5 @@ /* Malloc implementation for multiple threads without lock contention. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Wolfram Gloger and Doug Lea , 1996. @@ -3618,6 +3618,8 @@ Void_t* vALLOc(size_t bytes) Void_t* vALLOc(bytes) size_t bytes; #endif { + if(__malloc_initialized < 0) + ptmalloc_init (); return mEMALIGn (malloc_getpagesize, bytes); } @@ -3633,7 +3635,10 @@ Void_t* pvALLOc(size_t bytes) Void_t* pvALLOc(bytes) size_t bytes; #endif { - size_t pagesize = malloc_getpagesize; + size_t pagesize; + if(__malloc_initialized < 0) + ptmalloc_init (); + pagesize = malloc_getpagesize; return mEMALIGn (pagesize, (bytes + pagesize - 1) & ~(pagesize - 1)); }