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; }