commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1147972 - /commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
Date Mon, 18 Jul 2011 17:07:26 GMT
Author: mturk
Date: Mon Jul 18 17:07:25 2011
New Revision: 1147972

URL: http://svn.apache.org/viewvc?rev=1147972&view=rev
Log:
Seems that haks don't work with all VMs

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c?rev=1147972&r1=1147971&r2=1147972&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c Mon Jul 18 17:07:25 2011
@@ -335,10 +335,17 @@ ACR_JNI_EXPORT(jint, TestUnsafe, test0)(
 ACR_JNI_EXPORT(jobject, TestUnsafe, test1)(JNI_STDARGS, jobject o, jint off)
 {
     if (o != 0 && off > 0) {
+#if 0
+        /* This doesn't work on all VM's
+         * Seems objects can be compresses so just use the JNI call.
+         */
         char *oa = *(char **)o;
         if (oa != 0) {
             return (jobject)(oa + (ptrdiff_t)off);
         }
+#else
+        return CALL_METHOD2(Object, 0000, _unsafe_instance, o, off);
+#endif
     }
     return 0;
 }



Mime
View raw message