Remove unused code
Motivation: Cleanup PlatformDependent* and remove unused code. Modifications: Code cleanup Result: Removed unused code
This commit is contained in:
parent
5963279e58
commit
1e5d33f8d5
@ -31,7 +31,6 @@ import java.io.BufferedReader;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
@ -86,7 +85,6 @@ public final class PlatformDependent {
|
|||||||
private static final boolean CAN_ENABLE_TCP_NODELAY_BY_DEFAULT = !isAndroid();
|
private static final boolean CAN_ENABLE_TCP_NODELAY_BY_DEFAULT = !isAndroid();
|
||||||
|
|
||||||
private static final boolean HAS_UNSAFE = hasUnsafe0();
|
private static final boolean HAS_UNSAFE = hasUnsafe0();
|
||||||
private static final boolean CAN_USE_CHM_V8 = HAS_UNSAFE && JAVA_VERSION < 8;
|
|
||||||
private static final boolean DIRECT_BUFFER_PREFERRED =
|
private static final boolean DIRECT_BUFFER_PREFERRED =
|
||||||
HAS_UNSAFE && !SystemPropertyUtil.getBoolean("io.netty.noPreferDirect", false);
|
HAS_UNSAFE && !SystemPropertyUtil.getBoolean("io.netty.noPreferDirect", false);
|
||||||
private static final long MAX_DIRECT_MEMORY = maxDirectMemory0();
|
private static final long MAX_DIRECT_MEMORY = maxDirectMemory0();
|
||||||
@ -358,22 +356,10 @@ public final class PlatformDependent {
|
|||||||
"sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available");
|
"sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object getObject(Object object, long fieldOffset) {
|
|
||||||
return PlatformDependent0.getObject(object, fieldOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Object getObjectVolatile(Object object, long fieldOffset) {
|
|
||||||
return PlatformDependent0.getObjectVolatile(object, fieldOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getInt(Object object, long fieldOffset) {
|
public static int getInt(Object object, long fieldOffset) {
|
||||||
return PlatformDependent0.getInt(object, fieldOffset);
|
return PlatformDependent0.getInt(object, fieldOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long objectFieldOffset(Field field) {
|
|
||||||
return PlatformDependent0.objectFieldOffset(field);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte getByte(long address) {
|
public static byte getByte(long address) {
|
||||||
return PlatformDependent0.getByte(address);
|
return PlatformDependent0.getByte(address);
|
||||||
}
|
}
|
||||||
|
@ -339,10 +339,6 @@ final class PlatformDependent0 {
|
|||||||
return UNSAFE.getObject(object, fieldOffset);
|
return UNSAFE.getObject(object, fieldOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Object getObjectVolatile(Object object, long fieldOffset) {
|
|
||||||
return UNSAFE.getObjectVolatile(object, fieldOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int getInt(Object object, long fieldOffset) {
|
static int getInt(Object object, long fieldOffset) {
|
||||||
return UNSAFE.getInt(object, fieldOffset);
|
return UNSAFE.getInt(object, fieldOffset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user