From c4d7bbf7515af355071a0a3472798216416aa0ba Mon Sep 17 00:00:00 2001 From: tromey Date: Wed, 16 Aug 2000 15:30:02 +0000 Subject: 2000-08-15 Andrew Haley * include/jvm.h (_Jv_HashCode): New hash code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35744 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/include/jvm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libjava/include') diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index ad187c090b0..5d5e0b9b24b 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -163,7 +163,9 @@ void _Jv_RunMain (const char* name, int argc, const char **argv); inline jint _Jv_HashCode (jobject obj) { - return (jint) obj; + // This was chosen to yield relatively well distributed results on + // both 32- and 64-bit architectures. + return (jint) ((unsigned long long) obj % 0x7fffffff); } // Return a raw pointer to the elements of an array given the array -- cgit v1.2.3