From 11de5dcc881577bad6e3763c17c0fad4df27b7a3 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 16 Apr 2016 16:28:01 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9293 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/oslib/include/chheap.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/os/common/oslib/include/chheap.h b/os/common/oslib/include/chheap.h index 9a0bc083e..64840a0c7 100644 --- a/os/common/oslib/include/chheap.h +++ b/os/common/oslib/include/chheap.h @@ -36,8 +36,15 @@ /** * @brief Minimum alignment used for heap. + * @note Cannot use the sizeof operator in this macro. */ -#define CH_HEAP_ALIGNMENT sizeof (heap_header_t) +#if (SIZEOF_PTR == 4) || defined(__DOXYGEN__) +#define CH_HEAP_ALIGNMENT 8 +#elif (SIZEOF_PTR == 2) +#define CH_HEAP_ALIGNMENT 4 +#else +#error "unsupported pointer size" +#endif /*===========================================================================*/ /* Module pre-compile time settings. */