sun.misc.Unsafe.putObject()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(359)

本文整理了Java中sun.misc.Unsafe.putObject()方法的一些代码示例,展示了Unsafe.putObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.putObject()方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:putObject

Unsafe.putObject介绍

暂无

代码示例

代码示例来源:origin: google/guava

@Override
void putNext(Waiter waiter, Waiter newValue) {
 UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, newValue);
}

代码示例来源:origin: google/guava

@Override
void putThread(Waiter waiter, Thread newValue) {
 UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
}

代码示例来源:origin: netty/netty

static void putObject(Object o, long offset, Object x) {
  UNSAFE.putObject(o, offset, x);
}

代码示例来源:origin: prestodb/presto

@Override
void putThread(Waiter waiter, Thread newValue) {
 UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
}

代码示例来源:origin: prestodb/presto

@Override
void putNext(Waiter waiter, Waiter newValue) {
 UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, newValue);
}

代码示例来源:origin: redisson/redisson

static void putObject(Object o, long offset, Object x) {
  UNSAFE.putObject(o, offset, x);
}

代码示例来源:origin: ben-manes/caffeine

/**
 * A plain store (no ordering/fences) of an element to a given offset
 *
 * @param buffer this.buffer
 * @param offset computed via {@link UnsafeRefArrayAccess#calcElementOffset(long)}
 * @param e an orderly kitty
 */
public static <E> void spElement(E[] buffer, long offset, E e) {
 UNSAFE.putObject(buffer, offset, e);
}

代码示例来源:origin: neo4j/neo4j

public static void putObject( Object obj, long offset, Object value )
{
  unsafe.putObject( obj, offset, value );
}

代码示例来源:origin: google/j2objc

@Override
void putNext(Waiter waiter, Waiter newValue) {
 UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, newValue);
}

代码示例来源:origin: google/j2objc

@Override
void putThread(Waiter waiter, Thread newValue) {
 UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
}

代码示例来源:origin: jersey/jersey

/**
 * Constructs a new node.  Uses relaxed write because item can
 * only be seen after publication via casNext.
 */
Node(Object item, boolean isData) {
  UNSAFE.putObject(this, itemOffset, item); // relaxed write
  this.isData = isData;
}

代码示例来源:origin: jersey/jersey

/**
 * Links node to itself to avoid garbage retention.  Called
 * only after CASing head field, so uses relaxed write.
 */
final void forgetNext() {
  UNSAFE.putObject(this, nextOffset, this);
}

代码示例来源:origin: jersey/jersey

/**
 * Links node to itself to avoid garbage retention.  Called
 * only after CASing head field, so uses relaxed write.
 */
final void forgetNext() {
  UNSAFE.putObject(this, nextOffset, this);
}

代码示例来源:origin: jersey/jersey

/**
 * Constructs a new node.  Uses relaxed write because item can
 * only be seen after publication via casNext.
 */
Node(Object item, boolean isData) {
  UNSAFE.putObject(this, itemOffset, item); // relaxed write
  this.isData = isData;
}

代码示例来源:origin: apache/ignite

/**
 * Constructs a new node.  Uses relaxed write because item can
 * only be seen after publication via casNext or casPrev.
 */
Node(E item) {
  UNSAFE.putObject(this, itemOffset, item);
}

代码示例来源:origin: h2oai/h2o-2

/**
 * Links node to itself to avoid garbage retention.  Called
 * only after CASing head field, so uses relaxed write.
 */
final void forgetNext() {
  UNSAFE.putObject(this, nextOffset, this);
}

代码示例来源:origin: h2oai/h2o-2

/**
 * Constructs a new node.  Uses relaxed write because item can
 * only be seen after publication via casNext.
 */
Node(Object item, boolean isData) {
  UNSAFE.putObject(this, itemOffset, item); // relaxed write
  this.isData = isData;
}

代码示例来源:origin: h2oai/h2o-2

/**
 * Constructs a new node.  Uses relaxed write because item can
 * only be seen after publication via casNext or casPrev.
 */
Node(E item) {
  UNSAFE.putObject(this, itemOffset, item);
}

代码示例来源:origin: redisson/redisson

public final void setObjectValue(Object target, Object value) throws IllegalAccessException {
  if (!isAndroid && memOffset >= 0) {
    FSTUtil.unFlaggedUnsafe.putObject(target, memOffset, value);
    return;
  }
  field.set(target, value);
}

代码示例来源:origin: redisson/redisson

static String unsafeCreateString(char[] chars) {
  String mutable = new String();
  UNSAFE.putObject(mutable, STRING_VALUE_FIELD_OFFSET, chars);
  if (STRING_COUNT_FIELD_OFFSET != -1) {
    UNSAFE.putInt(mutable, STRING_COUNT_FIELD_OFFSET, chars.length);
  }
  return mutable;
}

相关文章

Unsafe类方法