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

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

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

Unsafe.putByteVolatile介绍

[英]Volatile version of #putByte(Object,long,byte)
[中]#putByte(Object,long,byte)的易失性版本

代码示例

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

@Override
public void putVolatile(long byteIndex, byte value) {
  unsafe.putByteVolatile(null, baseAdress + byteIndex, value);
}

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

@Override
public void putVolatile(long byteIndex, byte value) {
  unsafe.putByteVolatile(base, off + byteIndex, value);
}

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

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

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

/**
 * Stores byte value with volatile semantic.
 *
 * @param obj Object.
 * @param off Offset.
 * @param val Value.
 */
public static void putByteVolatile(Object obj, long off, byte val) {
  UNSAFE.putByteVolatile(obj, off, val);
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public void putVolatile(long byteIndex, byte value) {
  unsafe.putByteVolatile(base, off + byteIndex, value);
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public void putVolatile(long byteIndex, byte value) {
  unsafe.putByteVolatile(null, baseAdress + byteIndex, value);
}

代码示例来源:origin: fengjiachun/Jupiter

public void putByteVolatile(Object target, long offset, byte value) {
  unsafe.putByteVolatile(target, offset, value);
}

代码示例来源:origin: fengjiachun/Jupiter

public void putByteVolatile(Object target, long offset, byte value) {
  unsafe.putByteVolatile(target, offset, value);
}

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

public static void putByteVolatile( long address, byte value )
{
  checkAccess( address, Byte.BYTES );
  unsafe.putByteVolatile( null, address, value );
}

代码示例来源:origin: real-logic/agrona

public void putByteVolatile(final long index, final byte value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck(index);
  }
  UNSAFE.putByteVolatile(null, addressOffset + index, value);
}

代码示例来源:origin: real-logic/agrona

public void putByteVolatile(final int index, final byte value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck(index);
  }
  UNSAFE.putByteVolatile(byteArray, addressOffset + index, value);
}

代码示例来源:origin: Netflix/hollow

private void orderedCopy(byte[] src, int srcPos, byte[] dest, int destPos, int length) {
  int endSrcPos = srcPos + length;
  destPos += Unsafe.ARRAY_BYTE_BASE_OFFSET;
  while(srcPos < endSrcPos) {
    unsafe.putByteVolatile(dest, destPos++, src[srcPos++]);
  }
}

代码示例来源:origin: aaberg/sql2o

public void setProperty(Object obj, Object value) {
  if (value == null) return;
  theUnsafe.putByteVolatile(obj, offset, ((Number) value).byteValue());
}

代码示例来源:origin: org.apache.ignite/ignite-core

/**
 * Stores byte value with volatile semantic.
 *
 * @param obj Object.
 * @param off Offset.
 * @param val Value.
 */
public static void putByteVolatile(Object obj, long off, byte val) {
  UNSAFE.putByteVolatile(obj, off, val);
}

代码示例来源:origin: boonproject/boon

@Override
public void setByte( Object obj, byte value ) {
  unsafe.putByteVolatile( obj, offset, value );
}

代码示例来源:origin: org.agrona/Agrona

public void putByteVolatile(final int index, final byte value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck(index);
  }
  UNSAFE.putByteVolatile(byteArray, addressOffset + index, value);
}

代码示例来源:origin: OpenHFT/Chronicle-Core

@Override
@ForceInline
public void writeVolatileByte(@NotNull Object object, long offset, byte b) {
  if (object == null)
    throw new NullPointerException();
  UNSAFE.putByteVolatile(object, offset, b);
}

代码示例来源:origin: uk.co.real-logic/Agrona

public void putByteVolatile(final long index, final byte value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck(index);
  }
  UNSAFE.putByteVolatile(null, addressOffset + index, value);
}

代码示例来源:origin: net.openhft/chronicle-core

@Override
@ForceInline
public void writeVolatileByte(@NotNull Object object, long offset, byte b) {
  if (object == null)
    throw new NullPointerException();
  UNSAFE.putByteVolatile(object, offset, b);
}

代码示例来源:origin: OpenHFT/Chronicle-Core

@Override
@ForceInline
public void writeVolatileByte(long address, byte b) {
  UNSAFE.putByteVolatile(null, address, b);
}

相关文章

Unsafe类方法