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

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

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

Unsafe.getCharVolatile介绍

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

代码示例

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

@Override
public char getCharVolatile(long byteIndex) {
  return unsafe.getCharVolatile(base, off + byteIndex);
}

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

@Override
public char getCharVolatile(long byteIndex) {
  return unsafe.getCharVolatile(null, baseAdress + byteIndex);
}

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

public static char getCharVolatile( Object obj, long offset )
{
  return unsafe.getCharVolatile( obj, offset );
}

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

@Override
public char getCharVolatile(long byteIndex) {
  return unsafe.getCharVolatile(base, off + byteIndex);
}

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

@Override
public char getCharVolatile(long byteIndex) {
  return unsafe.getCharVolatile(null, baseAdress + byteIndex);
}

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

public static char getCharVolatile( long address )
{
  checkAccess( address, Character.BYTES );
  return unsafe.getCharVolatile( null, address );
}

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

public char getCharVolatile(final long index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_CHAR);
  }
  return UNSAFE.getCharVolatile(null, addressOffset + index);
}

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

public char getCharVolatile(final int index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_CHAR);
  }
  return UNSAFE.getCharVolatile(byteArray, addressOffset + index);
}

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

public Object getProperty(Object obj) {
  return theUnsafe.getCharVolatile(obj, offset);
}

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

@Override
  public char getChar( Object obj ) {
    return unsafe.getCharVolatile( obj, offset );
  }
}

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

@Override
  public char getChar( Object obj ) {
    return unsafe.getCharVolatile( obj, offset );
  }
}

代码示例来源:origin: io.fastjson/boon

@Override
  public char getChar( Object obj ) {
    return unsafe.getCharVolatile( obj, offset );
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public char getCharVolatile(Object base, long offset) {
  AlignmentUtil.check2BytesAligned(offset);
  return UNSAFE.getCharVolatile(base, offset);
}

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

public char getCharVolatile(final int index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_CHAR);
  }
  return UNSAFE.getCharVolatile(byteArray, addressOffset + index);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public char getCharVolatile(long address) {
  AlignmentUtil.check2BytesAligned(address);
  return UNSAFE.getCharVolatile(null, address);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public char getCharVolatile(long address) {
  AlignmentUtil.check2BytesAligned(address);
  return UNSAFE.getCharVolatile(null, address);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public char getCharVolatile(Object base, long offset) {
  AlignmentUtil.check2BytesAligned(offset);
  return UNSAFE.getCharVolatile(base, offset);
}

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

public char getCharVolatile(final int index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_CHAR);
  }
  return UNSAFE.getCharVolatile(byteArray, addressOffset + index);
}

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

public char getCharVolatile(final int index)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_CHAR);
  }
  return UNSAFE.getCharVolatile(byteArray, addressOffset + index);
}

代码示例来源:origin: peptos/traffic-shm

public static char getCharVolatile(Object object, long offset) {
  assert2BytesAligned(offset);
  char value = unsafe.getCharVolatile(object, offset);
  return (BIG_ENDIAN ? value : Bits.swap(value));
}

相关文章

Unsafe类方法