--- Begin Message ---
- To: jordy@wserv.com (Jordan Mendelson)
- Cc: libc-hacker@sourceware.cygnus.com (GNU C Library)
- Subject: A patch for malloc.
- From: hjl@lucon.org (H.J. Lu)
- Date: Fri, 6 Aug 1999 14:32:45 -0700 (PDT)
- Message-id: <19990806213245.E0AB457BB@ocean.lucon.org>
- In-reply-to: <37AB46E7.7228E760@wserv.com> from "Jordan Mendelson" at Aug 06, 1999 04:34:47 PM
>
>
> 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);
--- End Message ---