Exemplo n.º 1
0
  private static boolean canFreeDirectBuffer0() {
    if (isAndroid()) {
      return false;
    }

    return PlatformDependent0.canFreeDirectBuffer();
  }
Exemplo n.º 2
0
  private static boolean isUnaligned0() {
    if (!hasUnsafe()) {
      return false;
    }

    return PlatformDependent0.isUnaligned();
  }
Exemplo n.º 3
0
  private static boolean hasUnsafe0() {
    if (isAndroid()) {
      return false;
    }

    boolean noUnsafe = SystemPropertyUtil.getBoolean("io.netty.noUnsafe", false);
    if (noUnsafe) {
      return false;
    }

    // Legacy properties
    boolean tryUnsafe;
    if (SystemPropertyUtil.contains("io.netty.tryUnsafe")) {
      tryUnsafe = SystemPropertyUtil.getBoolean("io.netty.tryUnsafe", true);
    } else {
      tryUnsafe = SystemPropertyUtil.getBoolean("org.jboss.netty.tryUnsafe", true);
    }

    if (!tryUnsafe) {
      return false;
    }

    return PlatformDependent0.hasUnsafe();
  }
Exemplo n.º 4
0
 public static long directBufferAddress(ByteBuffer buffer) {
   return PlatformDependent0.directBufferAddress(buffer);
 }
Exemplo n.º 5
0
 public static void copyMemory(long srcAddr, long dstAddr, long length) {
   PlatformDependent0.copyMemory(srcAddr, dstAddr, length);
 }
Exemplo n.º 6
0
 public static void putInt(long address, int value) {
   PlatformDependent0.putInt(address, value);
 }
Exemplo n.º 7
0
 public static void putLong(long address, long value) {
   PlatformDependent0.putLong(address, value);
 }
Exemplo n.º 8
0
 public static void putByte(long address, byte value) {
   PlatformDependent0.putByte(address, value);
 }
Exemplo n.º 9
0
 public static void putShort(long address, short value) {
   PlatformDependent0.putShort(address, value);
 }
Exemplo n.º 10
0
 public static int getInt(long address) {
   return PlatformDependent0.getInt(address);
 }
Exemplo n.º 11
0
 public static long getLong(long address) {
   return PlatformDependent0.getLong(address);
 }
Exemplo n.º 12
0
 public static short getShort(long address) {
   return PlatformDependent0.getShort(address);
 }
Exemplo n.º 13
0
 public static byte getByte(long address) {
   return PlatformDependent0.getByte(address);
 }
Exemplo n.º 14
0
 public static long objectFieldOffset(Field field) {
   return PlatformDependent0.objectFieldOffset(field);
 }
Exemplo n.º 15
0
 public static Object getObject(Object object, long fieldOffset) {
   return PlatformDependent0.getObject(object, fieldOffset);
 }
Exemplo n.º 16
0
 /**
  * Try to deallocate the specified direct {@link ByteBuffer}. Please note this method does nothing
  * if the current platform does not support this operation or the specified buffer is not a direct
  * buffer.
  */
 public static void freeDirectBuffer(ByteBuffer buffer) {
   if (canFreeDirectBuffer() && buffer.isDirect()) {
     PlatformDependent0.freeDirectBuffer(buffer);
   }
 }