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:
|
private:
|
||||||
osMemoryPoolId_t _id;
|
osMemoryPoolId_t _id;
|
||||||
/* osMemoryPoolNew requires that pool block size is a multiple of 4 bytes. */
|
char _pool_mem[MBED_RTOS_STORAGE_MEM_POOL_MEM_SIZE(pool_sz, sizeof(T))];
|
||||||
char _pool_mem[((sizeof(T) + 3) & ~3) * pool_sz];
|
|
||||||
mbed_rtos_storage_mem_pool_t _obj_mem;
|
mbed_rtos_storage_mem_pool_t _obj_mem;
|
||||||
};
|
};
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
@ -192,5 +191,3 @@ private:
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@ typedef osRtxEventFlags_t mbed_rtos_storage_event_flags_t;
|
||||||
typedef osRtxMessage_t mbed_rtos_storage_message_t;
|
typedef osRtxMessage_t mbed_rtos_storage_message_t;
|
||||||
typedef osRtxTimer_t mbed_rtos_storage_timer_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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue