lib/os/heap: no need to over-mask

bmask already represents the intersection of h->avail_buckets and
wanted buckets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2021-03-17 22:31:59 -04:00 committed by Anas Nashif
commit f4e1611692

View file

@ -207,8 +207,8 @@ static chunkid_t alloc_chunk(struct z_heap *h, size_t sz)
*/
size_t bmask = h->avail_buckets & ~((1 << (bi + 1)) - 1);
if ((bmask & h->avail_buckets) != 0U) {
int minbucket = __builtin_ctz(bmask & h->avail_buckets);
if (bmask != 0U) {
int minbucket = __builtin_ctz(bmask);
chunkid_t c = h->buckets[minbucket].next;
free_list_remove_bidx(h, c, minbucket);