mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Automatic defaults for MemPoolBlockSize
This commit is contained in:
parent
72c89a1e0f
commit
cbf5450164
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user