mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
util/idalloc: make deleting invalid IDs a no-op
This happens with piglit tests if we enable ForceGLNamesReuse for everything. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27586>
This commit is contained in:
parent
5438b19104
commit
716e483cfb
1 changed files with 4 additions and 1 deletions
|
|
@ -144,8 +144,11 @@ ret:
|
|||
void
|
||||
util_idalloc_free(struct util_idalloc *buf, unsigned id)
|
||||
{
|
||||
assert(id / 32 < buf->num_elements);
|
||||
unsigned idx = id / 32;
|
||||
|
||||
if (idx >= buf->num_elements)
|
||||
return;
|
||||
|
||||
buf->lowest_free_idx = MIN2(idx, buf->lowest_free_idx);
|
||||
buf->data[idx] &= ~(1 << (id % 32));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue