summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_handle_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/u_handle_table.c')
-rw-r--r--src/gallium/auxiliary/util/u_handle_table.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_handle_table.c b/src/gallium/auxiliary/util/u_handle_table.c
index fae4ac4039..0bfb9e1b4a 100644
--- a/src/gallium/auxiliary/util/u_handle_table.c
+++ b/src/gallium/auxiliary/util/u_handle_table.c
@@ -241,6 +241,28 @@ handle_table_remove(struct handle_table *ht,
}
+unsigned
+handle_table_get_next_handle(struct handle_table *ht,
+ unsigned handle)
+{
+ unsigned index;
+
+ for(index = handle; index < ht->size; ++index) {
+ if(!ht->objects[index])
+ return index + 1;
+ }
+
+ return 0;
+}
+
+
+unsigned
+handle_table_get_first_handle(struct handle_table *ht)
+{
+ return handle_table_get_next_handle(ht, 0);
+}
+
+
void
handle_table_destroy(struct handle_table *ht)
{