diff --git a/libuavcan/include/uavcan/impl_constants.hpp b/libuavcan/include/uavcan/impl_constants.hpp index 726691a32f..0504628812 100644 --- a/libuavcan/include/uavcan/impl_constants.hpp +++ b/libuavcan/include/uavcan/impl_constants.hpp @@ -108,8 +108,13 @@ namespace uavcan * fit this size; otherwise compilation fails. */ #if UAVCAN_MEM_POOL_BLOCK_SIZE +/// Explicitly specified by the user. static const unsigned MemPoolBlockSize = UAVCAN_MEM_POOL_BLOCK_SIZE; +#elif defined(__BIGGEST_ALIGNMENT__) && (__BIGGEST_ALIGNMENT__ <= 8) +/// Convenient default for GCC-like compilers - if alignment allows, pool block size can be safely reduced. +static const unsigned MemPoolBlockSize = 56; #else +/// Safe default that should be OK for any platform. static const unsigned MemPoolBlockSize = 64; #endif