Skip to content

Commit ed69e7f

Browse files
rickgaiserfjtrujy
authored andcommitted
Fix nano malloc 16byte alignment
1 parent 3440aec commit ed69e7f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

newlib/libc/stdlib/nano-mallocr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@
114114
(((size) + (align) - (size_t)1) & ~((align) - (size_t)1))
115115

116116
/* Alignment of allocated block */
117+
#ifndef MALLOC_ALIGNMENT
117118
#define MALLOC_ALIGN (8U)
119+
#else
120+
#define MALLOC_ALIGN MALLOC_ALIGNMENT
121+
#endif
118122
#define CHUNK_ALIGN (sizeof(void*))
119123
#define MALLOC_PADDING ((MAX(MALLOC_ALIGN, CHUNK_ALIGN)) - CHUNK_ALIGN)
120124

0 commit comments

Comments
 (0)