mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
util: add hash functions for u64 data type
Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30142>
This commit is contained in:
parent
2a828c35a1
commit
2fcebf2f1e
2 changed files with 14 additions and 0 deletions
|
|
@ -663,6 +663,12 @@ _mesa_hash_u32(const void *key)
|
|||
return XXH32(key, 4, 0);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
_mesa_hash_u64(const void *key)
|
||||
{
|
||||
return XXH32(key, 8, 0);
|
||||
}
|
||||
|
||||
/** FNV-1a string hash implementation */
|
||||
uint32_t
|
||||
_mesa_hash_string(const void *_key)
|
||||
|
|
@ -709,6 +715,12 @@ _mesa_key_u32_equal(const void *a, const void *b)
|
|||
return *((const uint32_t *)a) == *((const uint32_t *)b);
|
||||
}
|
||||
|
||||
bool
|
||||
_mesa_key_u64_equal(const void *a, const void *b)
|
||||
{
|
||||
return *((const uint64_t *)a) == *((const uint64_t *)b);
|
||||
}
|
||||
|
||||
/**
|
||||
* String compare function for use as the comparison callback in
|
||||
* _mesa_hash_table_create().
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ uint32_t _mesa_hash_data_with_seed(const void *data, size_t size, uint32_t seed)
|
|||
uint32_t _mesa_hash_int(const void *key);
|
||||
uint32_t _mesa_hash_uint(const void *key);
|
||||
uint32_t _mesa_hash_u32(const void *key);
|
||||
uint32_t _mesa_hash_u64(const void *key);
|
||||
uint32_t _mesa_hash_string(const void *key);
|
||||
uint32_t _mesa_hash_string_with_length(const void *_key, unsigned length);
|
||||
uint32_t _mesa_hash_pointer(const void *pointer);
|
||||
|
|
@ -124,6 +125,7 @@ uint32_t _mesa_hash_pointer(const void *pointer);
|
|||
bool _mesa_key_int_equal(const void *a, const void *b);
|
||||
bool _mesa_key_uint_equal(const void *a, const void *b);
|
||||
bool _mesa_key_u32_equal(const void *a, const void *b);
|
||||
bool _mesa_key_u64_equal(const void *a, const void *b);
|
||||
bool _mesa_key_string_equal(const void *a, const void *b);
|
||||
bool _mesa_key_pointer_equal(const void *a, const void *b);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue