Skip to content
Permalink
Browse files

mempool: move BUILD_ASSERT to the end of K_MEM_POOL_DEFINE

Move BUILD_ASSERT to the end of K_MEM_POOL_DEFINE.
K_MEM_POOL_DEFINE can not be processed if
combined with an other macro like __section.

Fixes: #17313

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
  • Loading branch information...
jfischer-phytec-iot authored and andrewboie committed Jul 4, 2019
1 parent 528a2de commit 223a2b950fc915d9e50a9e3ec3d3fbcfc325df17
Showing with 2 additions and 2 deletions.
  1. +2 −2 include/kernel.h
@@ -4157,7 +4157,6 @@ struct k_mem_pool {
* @req K-MPOOL-001
*/
#define K_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align) \
BUILD_ASSERT(WB_UP(maxsz) >= _MPOOL_MINBLK); \
char __aligned(WB_UP(align)) _mpool_buf_##name[WB_UP(maxsz) * nmax \
+ _MPOOL_BITS_SIZE(maxsz, minsz, nmax)]; \
struct sys_mem_pool_lvl _mpool_lvls_##name[Z_MPOOL_LVLS(maxsz, minsz)]; \
@@ -4170,7 +4169,8 @@ struct k_mem_pool {
.levels = _mpool_lvls_##name, \
.flags = SYS_MEM_POOL_KERNEL \
} \
}
}; \
BUILD_ASSERT(WB_UP(maxsz) >= _MPOOL_MINBLK);

/**
* @brief Allocate memory from a memory pool.

0 comments on commit 223a2b9

Please sign in to comment.
You can’t perform that action at this time.