Patch: New hash function

Andrew Haley aph@cygnus.co.uk
Thu Aug 17 10:25:00 GMT 2000


Jeff Sturm writes:

 > I tried simply
 > 
 >   return (jint) ((unsigned long) obj % 0x7fffffff);
 > 
 > which i386 handles much better (about 55 cycles on my PIII),

Cool.  Sounds good enough to me.

 > and had no effect
 > on alpha.  It also doesn't need any conditional compilation.  Is that good
 > enough?

I think so.

 > Are there any platforms where sizeof(long) != sizeof(void*) that we
 > care about?

Good question.  I think that some compilers (eg IA-64) allow long
optionally to be 32-bit, but as far as I know Linux doesn't support
that.  M$ W*ndows NT, might, though...  :-)

I suppose we could use "unsigned int __attribute__ ((mode (Pmode)))"
or some similar evil.

Andrew.



More information about the Java-patches mailing list