Thomas Helland <thomashellan...@gmail.com> writes:

> Use our knowledge that pointers are at least 4 byte aligned to remove
> the useless digits. Then shift by 6, 10, and 14 bits and add this to
> the original pointer, effectively folding in the entropy of the higher
> bits of the pointer into a 4-bit section. Stopping at 14 means we can
> add the entropy from 18 bits, or at least a 600Kbyte section of memory.
> Assuming that ralloc allocates from a linearly allocated heap less than
> this we can make a very efficient pointer hashing function for our usecase.

The fnv1 on the pointer was basically a stand-in until someone did the
kind of analysis you've done here.  Thanks!

Reviewed-by: Eric Anholt <e...@anholt.net>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to