private static boolean canFreeDirectBuffer0() { if (isAndroid()) { return false; } return PlatformDependent0.canFreeDirectBuffer(); }
private static boolean isUnaligned0() { if (!hasUnsafe()) { return false; } return PlatformDependent0.isUnaligned(); }
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(); }
public static long directBufferAddress(ByteBuffer buffer) { return PlatformDependent0.directBufferAddress(buffer); }
public static void copyMemory(long srcAddr, long dstAddr, long length) { PlatformDependent0.copyMemory(srcAddr, dstAddr, length); }
public static void putInt(long address, int value) { PlatformDependent0.putInt(address, value); }
public static void putLong(long address, long value) { PlatformDependent0.putLong(address, value); }
public static void putByte(long address, byte value) { PlatformDependent0.putByte(address, value); }
public static void putShort(long address, short value) { PlatformDependent0.putShort(address, value); }
public static int getInt(long address) { return PlatformDependent0.getInt(address); }
public static long getLong(long address) { return PlatformDependent0.getLong(address); }
public static short getShort(long address) { return PlatformDependent0.getShort(address); }
public static byte getByte(long address) { return PlatformDependent0.getByte(address); }
public static long objectFieldOffset(Field field) { return PlatformDependent0.objectFieldOffset(field); }
public static Object getObject(Object object, long fieldOffset) { return PlatformDependent0.getObject(object, fieldOffset); }
/** * 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); } }