summaryrefslogtreecommitdiffstats
path: root/libjava/include
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/jvm.h4
1 files changed, 3 insertions, 1 deletions
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
OpenPOWER on IntegriCloud