From 8a216c1bd82f923812cb8a08db95c6558ca37c3c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 15 Feb 2001 03:39:03 +0000 Subject: Update. 2001-02-14 Wolfram Gloger * malloc/malloc.c (new_heap): When allocating large chunk aligned to HEAP_MAX_SIZE, prefer one with lower address, to avoid `holes' between the heaps. --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'malloc') diff --git a/malloc/malloc.c b/malloc/malloc.c index 311fd174a4..37249b0c7a 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2026,7 +2026,7 @@ new_heap(size) size_t size; anyway). */ p1 = (char *)MMAP(0, HEAP_MAX_SIZE<<1, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE); if(p1 != MAP_FAILED) { - p2 = (char *)(((unsigned long)p1 + HEAP_MAX_SIZE) & ~(HEAP_MAX_SIZE-1)); + p2 = (char *)(((unsigned long)p1 + (HEAP_MAX_SIZE-1)) & ~(HEAP_MAX_SIZE-1)); ul = p2 - p1; munmap(p1, ul); munmap(p2 + HEAP_MAX_SIZE, HEAP_MAX_SIZE - ul); -- cgit 1.4.1