[Mesa-dev] [PATCH v2] util: hash_table: move NULL assert to string hashing function

Eric Anholt eric at anholt.net
Tue Nov 28 20:19:59 UTC 2017


Lionel Landwerlin <lionel.g.landwerlin at intel.com> writes:

> Hash maps might use pointer keys (which people surely might want to
> use to hash values) in which case a 0 value is perfectly acceptable.
> It's only if the hash function needs to deference the pointer that we
> want to be sure it's not NULL.
>
> v2: Add assert in _mesa_fnv32_1a_accumulate_block (Ian)

No, a key of NULL is not valid.  That's the marker of entry_is_free().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171128/4d48d91c/attachment-0001.sig>


More information about the mesa-dev mailing list