Skip to content
Commit bb7c2e82 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Anas Nashif
Browse files

mempool: remove redundant bit set/clear within loops



When small blocks are recombined to create a single block at a shallower
level, it is sufficient to remove those blocks from the free list. There
is no need to mark those small blocks as allocated in the bitmap.

This, in turn, removes the need to mark small blocks back as unallocated
when splitting up a big blocks as they'll already be so marked.
Only the first small block needs to be marked allocated and the
remaining blocks only need to be added to the free list.

This makes the code smaller and more efficient, especially since those
removed bit manipulations were located within loops.

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