summaryrefslogtreecommitdiff
path: root/src/util/hash_table.h
AgeCommit message (Collapse)AuthorFilesLines
2016-09-12util: Move hash_table_call_foreach to util hash tableThomas Helland1-0/+13
It is included through the util/hash_table include in the program hash_table, so this should be safe. This will be needed when we start converting each use of the program_hash_table, as some places need this function. Signed-off-by: Thomas Helland <thomashelland90@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-02-18util: fix new gcc6 warningsRob Clark1-1/+3
src/util/hash_table.h:111:23: warning: ‘_mesa_fnv32_1a_offset_bias’ defined but not used [-Wunused-const-variable] static const uint32_t _mesa_fnv32_1a_offset_bias = 2166136261u; ^~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-02-03util/hash_table: add _mesa_hash_table_num_entriesNicolai Hähnle1-0/+5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-03util/hash_table: add _mesa_hash_table_clear (v4)Nicolai Hähnle1-0/+2
v4: coding style change (Matt Turner) Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
2015-01-15hash_table: Rename insert_with_hash to insert_pre_hashedJason Ekstrand1-2/+2
We already have search_pre_hashed. This makes the APIs match better. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-01-15util/hash_table: Pull the details of the FNV-1a into helpersJason Ekstrand1-0/+19
This way the basics of the FNV-1a hash can be reused to easily create other hashing functions. Reviewed-by: Eric Anholt <eric@anholt.net>
2014-12-14util/hash_table: Rework the API to know about hashingJason Ekstrand1-4/+15
Previously, the hash_table API required the user to do all of the hashing of keys as it passed them in. Since the hashing function is intrinsically tied to the comparison function, it makes sense for the hash table to know about it. Also, it makes for a somewhat clumsy API as the user is constantly calling hashing functions many of which have long names. This is especially bad when the standard call looks something like _mesa_hash_table_insert(ht, _mesa_pointer_hash(key), key, data); In the above case, there is no reason why the hash table shouldn't do the hashing for you. We leave the option for you to do your own hashing if it's more efficient, but it's no longer needed. Also, if you do do your own hashing, the hash table will assert that your hash matches what it expects out of the hashing function. This should make it harder to mess up your hashing. v2: change to call the old entrypoint "pre_hashed" rather than "with_hash", like cworth's equivalent change upstream (change by anholt, acked-in-general by Jason). Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-04util: include c99_compat.h in hash_table.h to get 'inline' definitionBrian Paul1-0/+1
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04util: Gather some common macrosJason Ekstrand1-2/+2
This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <jason.ekstrand@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04util: Move the open-addressing linear-probing hash_table to src/util.Kenneth Graunke1-0/+106
This hash table is used in core Mesa, the GLSL compiler, and the i965 driver, which makes it a good candidate for the new src/util module. It's much faster than program/hash_table.[ch] (see commit 6991c2922f5 for data), and José's u_hash_table.c has a comment saying Gallium should probably consider switching to a linear probing hash table at some point. So this seems like the best candidate for a shared data structure. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>