[PULL] [xorg/xserver] XRes v1.2

Keith Packard keithp at keithp.com
Tue Apr 5 07:54:00 PDT 2011


On Tue, 05 Apr 2011 13:59:05 +0300, Erkki Seppala <erkki.seppala at 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.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110405/3acd7f32/attachment.pgp>


More information about the xorg-devel mailing list