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

2017-11-28 Thread Eric Anholt
Lionel Landwerlin 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

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

2017-11-28 Thread Ian Romanick
On 11/28/2017 08:04 AM, Andres Gomez wrote: > On Tue, 2017-11-28 at 11:18 +, Lionel Landwerlin wrote: >> 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

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

2017-11-28 Thread Andres Gomez
On Tue, 2017-11-28 at 11:18 +, Lionel Landwerlin wrote: > 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 dereference

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

2017-11-28 Thread Lionel Landwerlin
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)