mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 05:23:34 +08:00
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.
This commit is contained in:
@@ -48,10 +48,10 @@
|
|||||||
# define UAVCAN_PACK_STRUCTS 0
|
# define UAVCAN_PACK_STRUCTS 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef UAVCAN_PACKED_BEGIN
|
#ifndef UAVCAN_PACKED_BEGIN
|
||||||
# define UAVCAN_PACKED_BEGIN _Pragma("pack(push, 1)")
|
# define UAVCAN_PACKED_BEGIN
|
||||||
#endif
|
#endif
|
||||||
#ifndef UAVCAN_PACKED_END
|
#ifndef UAVCAN_PACKED_END
|
||||||
# define UAVCAN_PACKED_END _Pragma("pack(pop)")
|
# define UAVCAN_PACKED_END
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -66,10 +66,14 @@ namespace uavcan
|
|||||||
#if UAVCAN_MEM_POOL_BLOCK_SIZE
|
#if UAVCAN_MEM_POOL_BLOCK_SIZE
|
||||||
enum { MemPoolBlockSize = UAVCAN_MEM_POOL_BLOCK_SIZE };
|
enum { MemPoolBlockSize = UAVCAN_MEM_POOL_BLOCK_SIZE };
|
||||||
#else
|
#else
|
||||||
enum { MemPoolBlockSize = 48 };
|
enum { MemPoolBlockSize = 64 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __BIGGEST_ALIGNMENT__
|
||||||
|
enum { MemPoolAlignment = __BIGGEST_ALIGNMENT__ };
|
||||||
|
#else
|
||||||
enum { MemPoolAlignment = 16 };
|
enum { MemPoolAlignment = 16 };
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef char _alignment_check_for_MEM_POOL_BLOCK_SIZE[((MemPoolBlockSize & (MemPoolAlignment - 1)) == 0) ? 1 : -1];
|
typedef char _alignment_check_for_MEM_POOL_BLOCK_SIZE[((MemPoolBlockSize & (MemPoolAlignment - 1)) == 0) ? 1 : -1];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user