当前位置: 首页>>代码示例>>Java>>正文


Java Unsafe.getObject方法代码示例

本文整理汇总了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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:UnsafeSubstitutionsTest.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:Test7190310_unsafe.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:Test7190310_unsafe.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:Test7190310_unsafe.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:Test7190310_unsafe.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:UnsafeSubstitutionsTest.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:WriteBarrierAdditionTest.java


注:本文中的sun.misc.Unsafe.getObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。