mempool: make alignment/rounding 64-bit compatible
Minimum alignment and rounding must be done on a word boundary. Let's replace _ALIGN4() with WB_UP() which is equivalent on 32-bit targets, and 64-bit aware. Also enforce a minimal alignment on the memory pool. This is making a difference mostly on64-bit targets where the widely used 4-byte alignment is not sufficient. The _ALIGN4() macro has no users left so it is removed. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
d62e229680
commit
cf974371fb
5 changed files with 9 additions and 11 deletions
|
@ -36,8 +36,6 @@ struct sys_mem_pool_base {
|
|||
u8_t flags;
|
||||
};
|
||||
|
||||
#define _ALIGN4(n) ((((n)+3)/4)*4)
|
||||
|
||||
#define Z_MPOOL_HAVE_LVL(maxsz, minsz, l) (((maxsz) >> (2*(l))) \
|
||||
>= (minsz) ? 1 : 0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue