diff options
-rw-r--r-- | lib/libstand/sbrk.c | 5 |
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 * |