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:
parent
a54e101a1e
commit
f4e1611692
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue