This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Re: Patch: New hash function
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.