當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。