tests/mem_pool_threadsafe: use actual minimum mempool block size
On 64-bit targets, the minimum possible mempool block size is not 8 but 16. With a max block size of 32, the mempool allocator cannot split it into 4 sub-blocks, reducing the available memory allocations to that original 32-byte block only. To get the same allocation patterns and test behavior whether it is built for a 32-bit or 64-bit architecture, let's define BLK_SIZE_MIN and BLK_SIZE_MAX in terms of _MPOOL_MINBLK instead of literal values. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
3aac8e3e19
commit
923a909db8
1 changed files with 3 additions and 3 deletions
|
@ -11,11 +11,11 @@
|
|||
#define POOL_NUM 2
|
||||
#define LOOPS 10
|
||||
#define TIMEOUT 200
|
||||
#define BLK_SIZE_MIN 8
|
||||
#define BLK_SIZE_MAX 32
|
||||
#define BLK_SIZE_MIN _MPOOL_MINBLK
|
||||
#define BLK_SIZE_MAX (4 * BLK_SIZE_MIN)
|
||||
#define BLK_NUM_MIN 8
|
||||
#define BLK_NUM_MAX 2
|
||||
#define BLK_ALIGN BLK_SIZE_MIN
|
||||
#define BLK_ALIGN sizeof(void *)
|
||||
|
||||
K_MEM_POOL_DEFINE(mpool1, BLK_SIZE_MIN, BLK_SIZE_MAX, BLK_NUM_MAX, BLK_ALIGN);
|
||||
K_MEM_POOL_DEFINE(mpool2, BLK_SIZE_MIN, BLK_SIZE_MAX, BLK_NUM_MAX, BLK_ALIGN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue