Hashtable's and the tale of runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Archie Cobbs writes:
 > Tom Tromey wrote:
 > > At some point we changed libgcj's hash function to this:
 > > 
 > >   // This was chosen to yield relatively well distributed results on
 > >   // both 32- and 64-bit architectures.  Note 0x7fffffff is prime.
 > >   return (jint) ((unsigned long) obj % 0x7fffffff);
 > 
 > What if you're on a 32-bit machine and all the object addresses
 > are less than 0x80000000.. won't that give you the same result
 > as just returning (jint)obj ?
 
Yes, it will.  It only really helps on 64-bit machines.

Andrew.


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux