diff options
Diffstat (limited to 'libjava/include/jvm.h')
-rw-r--r-- | libjava/include/jvm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 65178851085..e6e6fa6e4aa 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -164,8 +164,9 @@ inline jint _Jv_HashCode (jobject obj) { // This was chosen to yield relatively well distributed results on - // both 32- and 64-bit architectures. - return (jint) ((unsigned long long) obj % 0x7fffffff); + // both 32- and 64-bit architectures. Note 0x7fffffff is prime. + // FIXME: we assume sizeof(long) == sizeof(void *). + return (jint) ((unsigned long) obj % 0x7fffffff); } // Return a raw pointer to the elements of an array given the array |