diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-02-15 03:39:03 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-02-15 03:39:03 +0000 |
commit | 8a216c1bd82f923812cb8a08db95c6558ca37c3c (patch) | |
tree | a1310cadb251082e26390c66cda318d0a4eb1bb5 /malloc | |
parent | cd53c157cf172ebb61f9298e3c389ae84dbc0429 (diff) | |
download | glibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.zip glibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.tar.gz glibc-8a216c1bd82f923812cb8a08db95c6558ca37c3c.tar.bz2 |
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')
-rw-r--r-- | malloc/malloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 311fd17..37249b0 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); |