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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user