mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 17:21:36 +08:00
Automatic defaults for MemPoolBlockSize
This commit is contained in:
@@ -108,8 +108,13 @@ namespace uavcan
|
|||||||
* fit this size; otherwise compilation fails.
|
* fit this size; otherwise compilation fails.
|
||||||
*/
|
*/
|
||||||
#if UAVCAN_MEM_POOL_BLOCK_SIZE
|
#if UAVCAN_MEM_POOL_BLOCK_SIZE
|
||||||
|
/// Explicitly specified by the user.
|
||||||
static const unsigned MemPoolBlockSize = UAVCAN_MEM_POOL_BLOCK_SIZE;
|
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
|
#else
|
||||||
|
/// Safe default that should be OK for any platform.
|
||||||
static const unsigned MemPoolBlockSize = 64;
|
static const unsigned MemPoolBlockSize = 64;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user