本文整理匯總了Java中sun.misc.Unsafe.getObject方法的典型用法代碼示例。如果您正苦於以下問題:Java Unsafe.getObject方法的具體用法?Java Unsafe.getObject怎麽用?Java Unsafe.getObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sun.misc.Unsafe
的用法示例。
在下文中一共展示了Unsafe.getObject方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: unsafePutObject
import sun.misc.Unsafe; //導入方法依賴的package包/類
@SuppressWarnings("all")
public static Object[] unsafePutObject(Unsafe unsafe, Object obj, long offset, Object value1, Object value2, Object value3) {
Object[] res = new Object[3];
unsafe.putObject(obj, offset, value1);
res[0] = unsafe.getObject(obj, offset);
unsafe.putObjectVolatile(obj, offset, value2);
res[1] = unsafe.getObject(obj, offset);
unsafe.putOrderedObject(obj, offset, value3);
res[2] = unsafe.getObject(obj, offset);
return res;
}
示例2: getRef1
import sun.misc.Unsafe; //導入方法依賴的package包/類
static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception {
return unsafe.getObject(ref, referent_offset);
}
示例3: getRef2
import sun.misc.Unsafe; //導入方法依賴的package包/類
static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception {
return unsafe.getObject(ref, referent_offset);
}
示例4: getRef3
import sun.misc.Unsafe; //導入方法依賴的package包/類
static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception {
return unsafe.getObject(ref, referent_offset);
}
示例5: getRef4
import sun.misc.Unsafe; //導入方法依賴的package包/類
static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception {
return unsafe.getObject(ref, referent_offset);
}
示例6: unsafeGetObject
import sun.misc.Unsafe; //導入方法依賴的package包/類
@SuppressWarnings("all")
public static boolean unsafeGetObject(Unsafe unsafe, Object obj, long offset) {
return unsafe.getObject(obj, offset) == unsafe.getObjectVolatile(obj, offset);
}
示例7: testUnsafeLoad
import sun.misc.Unsafe; //導入方法依賴的package包/類
public static Object testUnsafeLoad(Unsafe theUnsafe, Object a, Object b, Object c) throws Exception {
final int offset = (c == null ? 0 : ((Integer) c).intValue());
final long displacement = (b == null ? 0 : ((Long) b).longValue());
return theUnsafe.getObject(a, offset + displacement);
}