From ae4a2bd820432ae02e02f5133783f66757051ffa Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 16 Dec 2014 20:46:25 +0000 Subject: [PATCH] * libc/stdlib/nano-mallocr.c (ALIGN_TO): Do not assume that integers are as big as pointers. --- newlib/ChangeLog | 5 +++++ newlib/libc/stdlib/nano-mallocr.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 0786ef4bb..d5f5e6644 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2014-12-16 DJ Delorie + + * libc/stdlib/nano-mallocr.c (ALIGN_TO): Do not assume that + integers are as big as pointers. + 2014-12-16 Richard Earnshaw * libc/machine/aarch64/strcpy.S: Improve handling of short strings. diff --git a/newlib/libc/stdlib/nano-mallocr.c b/newlib/libc/stdlib/nano-mallocr.c index cc9c87fbe..8d6ca5ce0 100644 --- a/newlib/libc/stdlib/nano-mallocr.c +++ b/newlib/libc/stdlib/nano-mallocr.c @@ -105,7 +105,7 @@ #define current_mallinfo __malloc_current_mallinfo #define ALIGN_TO(size, align) \ - (((size) + (align) -1) & ~((align) -1)) + (((size) + (align) -1L) & ~((align) -1L)) /* Alignment of allocated block */ #define MALLOC_ALIGN (8U)