Top Description Fields Constructors Methods
io.netty.util.internal

pack-priv final Class PlatformDependent0

extends Object
Class Inheritance
Annotations
@SuppressJava6Requirement
reason:Unsafe access is guarded
Imports
io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, sun.misc.Unsafe, java.lang.reflect.Constructor, .Field, .InvocationTargetException, .Method, java.nio.Buffer, .ByteBuffer, java.security.AccessController, .PrivilegedAction, java.util.concurrent.atomic.AtomicLong

The PlatformDependent operations which requires access to sun.misc.*.

Field Summary

Modifier and TypeField and Description
private static final long
private static final Method
private static final Method
private static final long
private static final long
private static final Constructor<?>
private static final Throwable
pack-priv static final int
pack-priv static final int
pack-priv static final int
private static final long
private static final long
private static final Object
private static final boolean
private static final boolean
private static final int
private static final InternalLogger
private static final long
private static final long
private static final boolean
private static final boolean
private static final boolean
pack-priv static final Unsafe
private static final long
UNSAFE_COPY_THRESHOLD

Limits the number of bytes to copy per Unsafe#copyMemory(long, long, long) to allow safepoint polling during a large copy.

private static final Throwable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
pack-priv static ByteBuffer
alignSlice(ByteBuffer buffer, int alignment)

pack-priv static ByteBuffer
pack-priv static long
allocateMemory(long size)

pack-priv static byte[]
pack-priv static long
bitsMaxDirectMemory()

Any value >= 0 should be considered as a valid max direct memory value.

pack-priv static long
pack-priv static void
copyMemory(long srcAddr, long dstAddr, long length)

pack-priv static void
copyMemory(Object src, long srcOffset, Object dst, long dstOffset, long length)

private static void
copyMemoryWithSafePointPolling(long srcAddr, long dstAddr, long length)

private static void
copyMemoryWithSafePointPolling(Object src, long srcOffset, Object dst, long dstOffset, long length)

pack-priv static long
pack-priv static boolean
equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)

pack-priv static int
equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)

private static Throwable
private static boolean
pack-priv static void
freeMemory(long address)

pack-priv static byte
getByte(long address)

pack-priv static byte
getByte(byte[] data, int index)

pack-priv static byte
getByte(byte[] data, long index)

pack-priv static ClassLoader
getClassLoader(final Class<?> clazz)

pack-priv static ClassLoader
pack-priv static int
getInt(Object object, long fieldOffset)

pack-priv static int
getInt(long address)

pack-priv static int
getInt(byte[] data, int index)

pack-priv static int
getInt(int[] data, long index)

pack-priv static int
getIntVolatile(long address)

private static long
getLong(Object object, long fieldOffset)

pack-priv static long
getLong(long address)

pack-priv static long
getLong(byte[] data, int index)

pack-priv static long
getLong(long[] data, long index)

pack-priv static Object
getObject(Object object, long fieldOffset)

pack-priv static short
getShort(long address)

pack-priv static short
getShort(byte[] data, int index)

pack-priv static ClassLoader
pack-priv static Throwable
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
pack-priv static int
hashCodeAscii(byte[] bytes, int startPos, int length)

pack-priv static int
hashCodeAsciiCompute(long value, int hash)

pack-priv static int
pack-priv static int
hashCodeAsciiSanitize(short value)

pack-priv static int
pack-priv static boolean
pack-priv static boolean
private static boolean
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
isZero(byte[] bytes, int startPos, int length)

pack-priv static int
private static int
pack-priv static int
majorVersion(final String javaSpecVersion)

pack-priv static int
pack-priv static ByteBuffer
newDirectBuffer(long address, int capacity)

pack-priv static long
pack-priv static void
putByte(long address, byte value)

pack-priv static void
putByte(byte[] data, int index, byte value)

pack-priv static void
putByte(Object data, long offset, byte value)

pack-priv static void
putInt(long address, int value)

pack-priv static void
putInt(byte[] data, int index, int value)

pack-priv static void
putIntOrdered(long adddress, int newValue)

pack-priv static void
putLong(long address, long value)

pack-priv static void
putLong(byte[] data, int index, long value)

pack-priv static void
putObject(Object o, long offset, Object x)

pack-priv static void
putShort(long address, short value)

pack-priv static void
putShort(byte[] data, int index, short value)

pack-priv static ByteBuffer
reallocateDirectNoCleaner(ByteBuffer buffer, int capacity)

pack-priv static long
reallocateMemory(long address, long newSize)

pack-priv static void
safeConstructPutInt(Object object, long fieldOffset, int value)

pack-priv static void
setMemory(long address, long bytes, byte value)

pack-priv static void
setMemory(Object o, long offset, long bytes, byte value)

pack-priv static void
pack-priv static boolean
private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADDRESS_FIELD_OFFSETback to summary
private static final long ADDRESS_FIELD_OFFSET
ALIGN_SLICEback to summary
private static final Method ALIGN_SLICE
ALLOCATE_ARRAY_METHODback to summary
private static final Method ALLOCATE_ARRAY_METHOD
BITS_MAX_DIRECT_MEMORYback to summary
private static final long BITS_MAX_DIRECT_MEMORY
BYTE_ARRAY_BASE_OFFSETback to summary
private static final long BYTE_ARRAY_BASE_OFFSET
DIRECT_BUFFER_CONSTRUCTORback to summary
private static final Constructor<?> DIRECT_BUFFER_CONSTRUCTOR
EXPLICIT_NO_UNSAFE_CAUSEback to summary
private static final Throwable EXPLICIT_NO_UNSAFE_CAUSE
HASH_CODE_ASCII_SEEDback to summary
pack-priv static final int HASH_CODE_ASCII_SEED
HASH_CODE_C1back to summary
pack-priv static final int HASH_CODE_C1
HASH_CODE_C2back to summary
pack-priv static final int HASH_CODE_C2
INT_ARRAY_BASE_OFFSETback to summary
private static final long INT_ARRAY_BASE_OFFSET
INT_ARRAY_INDEX_SCALEback to summary
private static final long INT_ARRAY_INDEX_SCALE
INTERNAL_UNSAFEback to summary
private static final Object INTERNAL_UNSAFE
IS_ANDROIDback to summary
private static final boolean IS_ANDROID
IS_EXPLICIT_TRY_REFLECTION_SET_ACCESSIBLEback to summary
private static final boolean IS_EXPLICIT_TRY_REFLECTION_SET_ACCESSIBLE
JAVA_VERSIONback to summary
private static final int JAVA_VERSION
loggerback to summary
private static final InternalLogger logger
LONG_ARRAY_BASE_OFFSETback to summary
private static final long LONG_ARRAY_BASE_OFFSET
LONG_ARRAY_INDEX_SCALEback to summary
private static final long LONG_ARRAY_INDEX_SCALE
RUNNING_IN_NATIVE_IMAGEback to summary
private static final boolean RUNNING_IN_NATIVE_IMAGE
STORE_FENCE_AVAILABLEback to summary
private static final boolean STORE_FENCE_AVAILABLE
UNALIGNEDback to summary
private static final boolean UNALIGNED
UNSAFEback to summary
pack-priv static final Unsafe UNSAFE
UNSAFE_COPY_THRESHOLDback to summary
private static final long UNSAFE_COPY_THRESHOLD

Limits the number of bytes to copy per Unsafe#copyMemory(long, long, long) to allow safepoint polling during a large copy.

UNSAFE_UNAVAILABILITY_CAUSEback to summary
private static final Throwable UNSAFE_UNAVAILABILITY_CAUSE

Constructor Detail

PlatformDependent0back to summary
private PlatformDependent0()

Method Detail

addressSizeback to summary
pack-priv static int addressSize()
alignSliceback to summary
pack-priv static ByteBuffer alignSlice(ByteBuffer buffer, int alignment)
allocateDirectNoCleanerback to summary
pack-priv static ByteBuffer allocateDirectNoCleaner(int capacity)
allocateMemoryback to summary
pack-priv static long allocateMemory(long size)
allocateUninitializedArrayback to summary
pack-priv static byte[] allocateUninitializedArray(int size)
bitsMaxDirectMemoryback to summary
pack-priv static long bitsMaxDirectMemory()

Any value >= 0 should be considered as a valid max direct memory value.

byteArrayBaseOffsetback to summary
pack-priv static long byteArrayBaseOffset()
copyMemoryback to summary
pack-priv static void copyMemory(long srcAddr, long dstAddr, long length)
copyMemoryback to summary
pack-priv static void copyMemory(Object src, long srcOffset, Object dst, long dstOffset, long length)
copyMemoryWithSafePointPollingback to summary
private static void copyMemoryWithSafePointPolling(long srcAddr, long dstAddr, long length)
copyMemoryWithSafePointPollingback to summary
private static void copyMemoryWithSafePointPolling(Object src, long srcOffset, Object dst, long dstOffset, long length)
directBufferAddressback to summary
pack-priv static long directBufferAddress(ByteBuffer buffer)
equalsback to summary
pack-priv static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
equalsConstantTimeback to summary
pack-priv static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
explicitNoUnsafeCause0back to summary
private static Throwable explicitNoUnsafeCause0()
explicitTryReflectionSetAccessible0back to summary
private static boolean explicitTryReflectionSetAccessible0()
freeMemoryback to summary
pack-priv static void freeMemory(long address)
getByteback to summary
pack-priv static byte getByte(long address)
getByteback to summary
pack-priv static byte getByte(byte[] data, int index)
getByteback to summary
pack-priv static byte getByte(byte[] data, long index)
getClassLoaderback to summary
pack-priv static ClassLoader getClassLoader(final Class<?> clazz)
getContextClassLoaderback to summary
pack-priv static ClassLoader getContextClassLoader()
getIntback to summary
pack-priv static int getInt(Object object, long fieldOffset)
getIntback to summary
pack-priv static int getInt(long address)
getIntback to summary
pack-priv static int getInt(byte[] data, int index)
getIntback to summary
pack-priv static int getInt(int[] data, long index)
getIntVolatileback to summary
pack-priv static int getIntVolatile(long address)
getLongback to summary
private static long getLong(Object object, long fieldOffset)
getLongback to summary
pack-priv static long getLong(long address)
getLongback to summary
pack-priv static long getLong(byte[] data, int index)
getLongback to summary
pack-priv static long getLong(long[] data, long index)
getObjectback to summary
pack-priv static Object getObject(Object object, long fieldOffset)
getShortback to summary
pack-priv static short getShort(long address)
getShortback to summary
pack-priv static short getShort(byte[] data, int index)
getSystemClassLoaderback to summary
pack-priv static ClassLoader getSystemClassLoader()
getUnsafeUnavailabilityCauseback to summary
pack-priv static Throwable getUnsafeUnavailabilityCause()
hasAlignSliceMethodback to summary
pack-priv static boolean hasAlignSliceMethod()
hasAllocateArrayMethodback to summary
pack-priv static boolean hasAllocateArrayMethod()
hasDirectBufferNoCleanerConstructorback to summary
pack-priv static boolean hasDirectBufferNoCleanerConstructor()
hashCodeAsciiback to summary
pack-priv static int hashCodeAscii(byte[] bytes, int startPos, int length)
hashCodeAsciiComputeback to summary
pack-priv static int hashCodeAsciiCompute(long value, int hash)
hashCodeAsciiSanitizeback to summary
pack-priv static int hashCodeAsciiSanitize(int value)
hashCodeAsciiSanitizeback to summary
pack-priv static int hashCodeAsciiSanitize(short value)
hashCodeAsciiSanitizeback to summary
pack-priv static int hashCodeAsciiSanitize(byte value)
hasUnsafeback to summary
pack-priv static boolean hasUnsafe()
isAndroidback to summary
pack-priv static boolean isAndroid()
isAndroid0back to summary
private static boolean isAndroid0()
isExplicitNoUnsafeback to summary
pack-priv static boolean isExplicitNoUnsafe()
isExplicitTryReflectionSetAccessibleback to summary
pack-priv static boolean isExplicitTryReflectionSetAccessible()
isUnalignedback to summary
pack-priv static boolean isUnaligned()
isZeroback to summary
pack-priv static boolean isZero(byte[] bytes, int startPos, int length)
javaVersionback to summary
pack-priv static int javaVersion()
javaVersion0back to summary
private static int javaVersion0()
majorVersionback to summary
pack-priv static int majorVersion(final String javaSpecVersion)
majorVersionFromJavaSpecificationVersionback to summary
pack-priv static int majorVersionFromJavaSpecificationVersion()
newDirectBufferback to summary
pack-priv static ByteBuffer newDirectBuffer(long address, int capacity)
objectFieldOffsetback to summary
pack-priv static long objectFieldOffset(Field field)
putByteback to summary
pack-priv static void putByte(long address, byte value)
putByteback to summary
pack-priv static void putByte(byte[] data, int index, byte value)
putByteback to summary
pack-priv static void putByte(Object data, long offset, byte value)
putIntback to summary
pack-priv static void putInt(long address, int value)
putIntback to summary
pack-priv static void putInt(byte[] data, int index, int value)
putIntOrderedback to summary
pack-priv static void putIntOrdered(long adddress, int newValue)
putLongback to summary
pack-priv static void putLong(long address, long value)
putLongback to summary
pack-priv static void putLong(byte[] data, int index, long value)
putObjectback to summary
pack-priv static void putObject(Object o, long offset, Object x)
putShortback to summary
pack-priv static void putShort(long address, short value)
putShortback to summary
pack-priv static void putShort(byte[] data, int index, short value)
reallocateDirectNoCleanerback to summary
pack-priv static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity)
reallocateMemoryback to summary
pack-priv static long reallocateMemory(long address, long newSize)
safeConstructPutIntback to summary
pack-priv static void safeConstructPutInt(Object object, long fieldOffset, int value)
setMemoryback to summary
pack-priv static void setMemory(long address, long bytes, byte value)
setMemoryback to summary
pack-priv static void setMemory(Object o, long offset, long bytes, byte value)
throwExceptionback to summary
pack-priv static void throwException(Throwable cause)
unalignedAccessback to summary
pack-priv static boolean unalignedAccess()
unsafeStaticFieldOffsetSupportedback to summary
private static boolean unsafeStaticFieldOffsetSupported()