On Tue, 05 Apr 2011 13:59:05 +0300, Erkki Seppala <erkki.sepp...@vincit.fi> wrote:
> Changed the interface - I still call the function HashResourceID, > though, because it is really usable only for hashing resource IDs. Yeah, quite sensible. > Internally resource.c now uses the same static function Hash implemented > in terms of HashResourceID. Please just fix users of the existing 'Hash' function to call HashResourceID directly. > The unsigned return value was because it doesn't make sense to me for a > hashing operation to fail. Indeed, the return value is never checked in > resource.c and should the function ever return -1, it will likely cause > random data corruption or crashes. Perhaps it should be an assert > instead. Or just use case 11: as the default; that would work for any accidental increases in the client hashsize value. What an ugly function. I like to avoid power-of-two hash tables and use prime sizes to ensure reasonable distribution instead of relying on hash value tricks. -- keith.pack...@intel.com
pgpu7MAk5rC3p.pgp
Description: PGP signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel