about summary refs log tree commit diff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-15 03:39:03 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-15 03:39:03 +0000
commit8a216c1bd82f923812cb8a08db95c6558ca37c3c (patch)
treea1310cadb251082e26390c66cda318d0a4eb1bb5 /malloc/malloc.c
parentcd53c157cf172ebb61f9298e3c389ae84dbc0429 (diff)
downloadglibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.tar.gz
glibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.tar.xz
glibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.zip
Update.
2001-02-14  Wolfram Gloger  <wg@malloc.de>

	* 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.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c2
1 files changed, 1 insertions, 1 deletions
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);