summaryrefslogtreecommitdiffstats
path: root/lib/libstand/sbrk.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand/sbrk.c')
-rw-r--r--lib/libstand/sbrk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libstand/sbrk.c b/lib/libstand/sbrk.c
index fce03cf..3263111 100644
--- a/lib/libstand/sbrk.c
+++ b/lib/libstand/sbrk.c
@@ -39,8 +39,9 @@ static void *heapbase;
void
setheap(void *base, void *top)
{
- heapbase = base;
- maxheap = top - base;
+ /* Align start address to 16 bytes for the malloc code. Sigh. */
+ heapbase = (void *)(((uintptr_t)base + 15) & ~15);
+ maxheap = top - heapbase;
}
char *
OpenPOWER on IntegriCloud