util/idalloc: add lowest_free_idx to avoid iterating from 0

lowest_free_idx is a conservative estimation of the lowest index
where a free id can be found.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6600>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2020-09-07 15:15:50 +02:00
parent e808d38299
commit 553d371933
2 changed files with 8 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ struct util_idalloc
{
uint32_t *data;
unsigned num_elements;
unsigned lowest_free_idx;
};
void