mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #10706 from hugueskamba/fix-softcoding-mem-pool-size-evaluation
mem pool size: Fix calculation of memory pool size for portabilitypull/10896/head
commit
e39aeff69e
|
@ -183,8 +183,7 @@ public:
|
|||
|
||||
private:
|
||||
osMemoryPoolId_t _id;
|
||||
/* osMemoryPoolNew requires that pool block size is a multiple of 4 bytes. */
|
||||
char _pool_mem[((sizeof(T) + 3) & ~3) * pool_sz];
|
||||
char _pool_mem[MBED_RTOS_STORAGE_MEM_POOL_MEM_SIZE(pool_sz, sizeof(T))];
|
||||
mbed_rtos_storage_mem_pool_t _obj_mem;
|
||||
};
|
||||
/** @}*/
|
||||
|
@ -192,5 +191,3 @@ private:
|
|||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,9 @@ typedef osRtxEventFlags_t mbed_rtos_storage_event_flags_t;
|
|||
typedef osRtxMessage_t mbed_rtos_storage_message_t;
|
||||
typedef osRtxTimer_t mbed_rtos_storage_timer_t;
|
||||
|
||||
#define MBED_RTOS_STORAGE_MEM_POOL_MEM_SIZE(block_count, block_size) \
|
||||
osRtxMemoryPoolMemSize(block_count, block_size)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue