On Tue, Dec 4, 2012 at 10:41 AM, Eric Anholt <e...@anholt.net> wrote: > Ian Romanick <i...@freedesktop.org> writes: >> On 12/03/2012 02:52 PM, Jordan Justen wrote: >>> +static bool >>> +pointer_key_compare(const void *a, const void *b) >>> +{ >>> + return a == b; >>> +} >>> + >>> +/* We could do better. */ >>> +static uint32_t >>> +pointer_hash(void *a) >>> +{ >>> + return (uintptr_t)a; >> >> Perhaps... >> >> return (uintptr_t) a / sizeof(ir_variable); >> >> Or at least shift of the low couple bits. Otherwise we know a lot of >> bins will be empty, right? (Or is this not that kind of hash table?) > > It's prime-sized.
Should I just use _mesa_key_pointer_equal and _mesa_hash_pointer? -Jordan _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev