From e077bbf7a991488c69dcc03f75beb4b01825c6cb Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 5 Apr 2014 16:55:03 +0400 Subject: [PATCH] Defaults for dynamic memory: Default block size is 64 bytes; packing is disabled by default; alignment set to __BIGGEST_ALIGNMENT__ if available, otherwise 16 bytes. --- libuavcan/include/uavcan/impl_constants.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libuavcan/include/uavcan/impl_constants.hpp b/libuavcan/include/uavcan/impl_constants.hpp index 82c859676c..b74b23c7a1 100644 --- a/libuavcan/include/uavcan/impl_constants.hpp +++ b/libuavcan/include/uavcan/impl_constants.hpp @@ -48,10 +48,10 @@ # define UAVCAN_PACK_STRUCTS 0 #endif #ifndef UAVCAN_PACKED_BEGIN -# define UAVCAN_PACKED_BEGIN _Pragma("pack(push, 1)") +# define UAVCAN_PACKED_BEGIN #endif #ifndef UAVCAN_PACKED_END -# define UAVCAN_PACKED_END _Pragma("pack(pop)") +# define UAVCAN_PACKED_END #endif @@ -66,10 +66,14 @@ namespace uavcan #if UAVCAN_MEM_POOL_BLOCK_SIZE enum { MemPoolBlockSize = UAVCAN_MEM_POOL_BLOCK_SIZE }; #else -enum { MemPoolBlockSize = 48 }; +enum { MemPoolBlockSize = 64 }; #endif +#ifdef __BIGGEST_ALIGNMENT__ +enum { MemPoolAlignment = __BIGGEST_ALIGNMENT__ }; +#else enum { MemPoolAlignment = 16 }; +#endif typedef char _alignment_check_for_MEM_POOL_BLOCK_SIZE[((MemPoolBlockSize & (MemPoolAlignment - 1)) == 0) ? 1 : -1];