aboutsummaryrefslogtreecommitdiffstats
path: root/os/common
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-04-16 16:28:01 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-04-16 16:28:01 +0000
commit11de5dcc881577bad6e3763c17c0fad4df27b7a3 (patch)
tree0437a963efe6448c6d1a9852097c6669bae6142a /os/common
parentd57f92801471b1337ed49d989026e1c212cdfc73 (diff)
downloadChibiOS-11de5dcc881577bad6e3763c17c0fad4df27b7a3.tar.gz
ChibiOS-11de5dcc881577bad6e3763c17c0fad4df27b7a3.tar.bz2
ChibiOS-11de5dcc881577bad6e3763c17c0fad4df27b7a3.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9293 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common')
-rw-r--r--os/common/oslib/include/chheap.h9
1 files changed, 8 insertions, 1 deletions
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. */