From f74e61f05626503cc5e469b940bdb149c98d7ab8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 22 Jul 2000 02:16:52 +0000 Subject: Update. 2000-07-21 Wolfram Gloger * malloc/malloc.c (chunk_alloc): Try mmap_chunk() for smaller allocations only if a non-main arena cannot be extended. * sysdeps/powerpc/bp-asm.h (DISCARD_BOUNDS): Rename from UNCHECK_BOUNDS. --- malloc/malloc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'malloc/malloc.c') diff --git a/malloc/malloc.c b/malloc/malloc.c index 68d8752..ce8de80 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2938,9 +2938,12 @@ chunk_alloc(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb; if ((remainder_size = chunksize(top(ar_ptr)) - nb) < (long)MINSIZE) { #if HAVE_MMAP - /* A last attempt: when we are out of address space in the arena, - try mmap anyway, as long as it is allowed at all. */ - if (n_mmaps_max > 0 && (victim = mmap_chunk(nb)) != 0) + /* A last attempt: when we are out of address space in a + non-main arena, try mmap anyway, as long as it is allowed at + all. */ + if (ar_ptr != &main_arena && + n_mmaps_max > 0 && + (victim = mmap_chunk(nb)) != 0) return victim; #endif return 0; /* propagate failure */ -- cgit v1.1