本文整理汇总了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);
}