src/intel: use new hash table and set creation helpers
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 11 Jan 2019 20:01:30 +0000 (12:01 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 14 Jan 2019 18:49:33 +0000 (10:49 -0800)
Replace calls to create hash tables and sets that use
_mesa_hash_pointer/_mesa_key_pointer_equal with the helpers
_mesa_pointer_hash_table_create() and _mesa_pointer_set_create().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Eric Engestrom <eric@engestrom.ch>
src/intel/tools/intel_sanitize_gpu.c
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_batch_chain.c

index 8f4f2ff8ec6295e9505aefd52362620eea0dec6b..ddfe1768b4a84aeae84ec81c8813be696aa6842c 100644 (file)
@@ -110,8 +110,7 @@ add_drm_fd(int fd)
 {
    struct refcnt_hash_table *r = malloc(sizeof(*r));
    r->refcnt = 1;
-   r->t = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
-                                  _mesa_key_pointer_equal);
+   r->t = _mesa_pointer_hash_table_create(NULL);
    _mesa_hash_table_insert(fds_to_bo_sizes, (void*)(uintptr_t)fd,
                            (void*)(uintptr_t)r);
 }
@@ -426,8 +425,7 @@ ioctl(int fd, unsigned long request, ...)
 static void __attribute__ ((constructor))
 init(void)
 {
-   fds_to_bo_sizes = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
-                                             _mesa_key_pointer_equal);
+   fds_to_bo_sizes = _mesa_pointer_hash_table_create(NULL);
    libc_open = dlsym(RTLD_NEXT, "open");
    libc_close = dlsym(RTLD_NEXT, "close");
    libc_fcntl = dlsym(RTLD_NEXT, "fcntl");
index 1bfffbea4e6154d3c0d5e59d03b8f7012e720a52..fe26bcbeefda5f5410928cb9558e0ea809bfde3c 100644 (file)
@@ -1201,8 +1201,7 @@ struct anv_cached_bo {
 VkResult
 anv_bo_cache_init(struct anv_bo_cache *cache)
 {
-   cache->bo_map = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
-                                           _mesa_key_pointer_equal);
+   cache->bo_map = _mesa_pointer_hash_table_create(NULL);
    if (!cache->bo_map)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
index a9f8c5b79b1580bb18bcff140fb8949f915320e3..a41305bc6d134d5f2f9b55a6b43fc5bdc7a393d8 100644 (file)
@@ -75,8 +75,7 @@ anv_reloc_list_init_clone(struct anv_reloc_list *list,
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
    }
 
-   list->deps = _mesa_set_create(NULL, _mesa_hash_pointer,
-                                 _mesa_key_pointer_equal);
+   list->deps = _mesa_pointer_set_create(NULL);
 
    if (!list->deps) {
       vk_free(alloc, list->relocs);