From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: jordy@wserv.com (Jordan Mendelson) Cc: libc-hacker@sourceware.cygnus.com (GNU C Library) Subject: A patch for malloc. Date: Fri, 06 Aug 1999 14:33:00 -0000 Message-id: <19990806213245.E0AB457BB@ocean.lucon.org> References: <37AB46E7.7228E760@wserv.com> X-SW-Source: 1999-08/msg00011.html > > > 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 * 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);