This is the mail archive of the libc-hacker@sources.redhat.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]

Re: Malloc Problem in glibc 2.2


Hello,

> It would be according to the docu:
> @item M_MMAP_MAX
> The maximum number of chunks to allocate with @code{mmap}.  Setting this
> to zero disables all use of @code{mmap}.
> @end table
> 
> Please send a patch,

OK here it is.  Thanks.

Regards,
Wolfram.

2000-07-17  Wolfram Gloger  <wg@malloc.de>

	* malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed,
	i.e. if n_mmaps_max>0.

Index: libc/malloc/malloc.c
===================================================================
RCS file: /cvs/glibc/libc/malloc/malloc.c,v
retrieving revision 1.63
diff -u -r1.63 malloc.c
--- malloc.c	2000/06/28 23:27:03	1.63
+++ malloc.c	2000/07/17 10:18:15
@@ -2942,8 +2942,8 @@
     {
 #if HAVE_MMAP
       /* A last attempt:  when we are out of address space in the arena,
-         try mmap anyway, disregarding n_mmaps_max.  */
-      if((victim = mmap_chunk(nb)) != 0)
+         try mmap anyway, as long as it is allowed at all.  */
+      if (n_mmaps_max > 0 && (victim = mmap_chunk(nb)) != 0)
         return victim;
 #endif
       return 0; /* propagate failure */

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