mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
util/idalloc: Fix util_idalloc_foreach() build issue
Currently `util_idalloc_foreach()` isn't being used in the codebase
but if used it causes a build error as `num_used` doesn't exist.
Fix that by using `num_set_elements`.
Fixes: 0589dfe4e2 ("util/idalloc: optimize foreach by tracking the greatest non-zero element")
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32546>
This commit is contained in:
parent
03fc483813
commit
af346cd77f
1 changed files with 1 additions and 1 deletions
|
|
@ -71,7 +71,7 @@ util_idalloc_reserve(struct util_idalloc *buf, unsigned id);
|
|||
|
||||
#define util_idalloc_foreach(buf, id) \
|
||||
for (uint32_t _i = 0, _mask = (buf)->num_set_elements ? (buf)->data[0] : 0, id, \
|
||||
_count = (buf)->num_used; \
|
||||
_count = (buf)->num_set_elements; \
|
||||
_i < _count; _mask = ++_i < _count ? (buf)->data[_i] : 0) \
|
||||
while (_mask) \
|
||||
if ((id = _i * 32 + u_bit_scan(&_mask)), true)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue