Skip to content
Commit 479c1aa6 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Andrew Boie
Browse files

mempool: simplify the logic for sizing the free block bitmap



Z_MPOOL_LVLS() expands into the sum of 16 _MPOOL_HAVE_LVL() instances,
and _MPOOL_BITS_SIZE() expands into the sum of 16 Z_MPOOL_LVLS()
instances. In the end, a single _MPOOL_BITS_SIZE() expands to 256
_MPOOL_HAVE_LVL() instances!

Let's make it slightly easier on the compiler, and easier for humans
too, by reworking Z_MPOOL_HAVE_LVL(() so that ic can be used directly
into Z_MPOOL_LBIT_BYTES(), making the code logic much simpler.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent 61f073a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment