This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A patch for malloc.


> 
> 
> This one is a bit hard to get at, but this is what I see:
> 

Please try this patch. __libc_pagesize handling in glibc 2.1.2 and 2.2
is wrong since __pthread_initialize will call malloc () with wrong
__libc_pagesize. This patch fixes glibc 2.1.2.

Ulrich, please fix both glibc 2.1.2 and 2.2.

Thanks.


H.J.
---
Fri Aug  6 14:21:24 1999  H.J. Lu  <hjl@gnu.org>

        * malloc/malloc.c (ptmalloc_init): Make sure __libc_pagesize is
        initiailized before any calls to malloc.

--- ../../import/glibc-2.1/libc/malloc/malloc.c	Wed Jul 21 07:30:38 1999
+++ malloc/malloc.c	Fri Aug  6 14:25:42 1999
@@ -1649,6 +1649,9 @@ ptmalloc_init __MALLOC_P((void))
 
   if(__malloc_initialized >= 0) return;
   __malloc_initialized = 0;
+#ifdef _LIBC
+  __libc_pagesize = __getpagesize();
+#endif
 #ifndef NO_THREADS
 #if defined _LIBC || defined MALLOC_HOOKS
   /* With some threads implementations, creating thread-specific data
@@ -1663,7 +1666,6 @@ ptmalloc_init __MALLOC_P((void))
   /* Initialize the pthreads interface. */
   if (__pthread_initialize != NULL)
     __pthread_initialize();
-  __libc_pagesize = __getpagesize();
 #endif
   mutex_init(&main_arena.mutex);
   mutex_init(&list_lock);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]