Class PlatformDependent0

java.lang.Object
io.netty.util.internal.PlatformDependent0

final class PlatformDependent0 extends Object
The PlatformDependent operations which requires access to sun.misc.*.
  • Field Details

    • logger

      private static final InternalLogger logger
    • ADDRESS_FIELD_OFFSET

      private static final long ADDRESS_FIELD_OFFSET
    • BYTE_ARRAY_BASE_OFFSET

      private static final long BYTE_ARRAY_BASE_OFFSET
    • INT_ARRAY_BASE_OFFSET

      private static final long INT_ARRAY_BASE_OFFSET
    • INT_ARRAY_INDEX_SCALE

      private static final long INT_ARRAY_INDEX_SCALE
    • LONG_ARRAY_BASE_OFFSET

      private static final long LONG_ARRAY_BASE_OFFSET
    • LONG_ARRAY_INDEX_SCALE

      private static final long LONG_ARRAY_INDEX_SCALE
    • DIRECT_BUFFER_CONSTRUCTOR

      private static final Constructor<?> DIRECT_BUFFER_CONSTRUCTOR
    • EXPLICIT_NO_UNSAFE_CAUSE

      private static final Throwable EXPLICIT_NO_UNSAFE_CAUSE
    • ALLOCATE_ARRAY_METHOD

      private static final Method ALLOCATE_ARRAY_METHOD
    • ALIGN_SLICE

      private static final Method ALIGN_SLICE
    • JAVA_VERSION

      private static final int JAVA_VERSION
    • IS_ANDROID

      private static final boolean IS_ANDROID
    • STORE_FENCE_AVAILABLE

      private static final boolean STORE_FENCE_AVAILABLE
    • UNSAFE_UNAVAILABILITY_CAUSE

      private static final Throwable UNSAFE_UNAVAILABILITY_CAUSE
    • INTERNAL_UNSAFE

      private static final Object INTERNAL_UNSAFE
    • RUNNING_IN_NATIVE_IMAGE

      private static final boolean RUNNING_IN_NATIVE_IMAGE
    • IS_EXPLICIT_TRY_REFLECTION_SET_ACCESSIBLE

      private static final boolean IS_EXPLICIT_TRY_REFLECTION_SET_ACCESSIBLE
    • UNSAFE

      static final sun.misc.Unsafe UNSAFE
    • HASH_CODE_ASCII_SEED

      static final int HASH_CODE_ASCII_SEED
      See Also:
    • HASH_CODE_C1

      static final int HASH_CODE_C1
      See Also:
    • HASH_CODE_C2

      static final int HASH_CODE_C2
      See Also:
    • UNSAFE_COPY_THRESHOLD

      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.
      See Also:
    • UNALIGNED

      private static final boolean UNALIGNED
    • BITS_MAX_DIRECT_MEMORY

      private static final long BITS_MAX_DIRECT_MEMORY
  • Constructor Details

    • PlatformDependent0

      private PlatformDependent0()
  • Method Details

    • unsafeStaticFieldOffsetSupported

      private static boolean unsafeStaticFieldOffsetSupported()
    • isExplicitNoUnsafe

      static boolean isExplicitNoUnsafe()
    • explicitNoUnsafeCause0

      private static Throwable explicitNoUnsafeCause0()
    • isUnaligned

      static boolean isUnaligned()
    • bitsMaxDirectMemory

      static long bitsMaxDirectMemory()
      Any value >= 0 should be considered as a valid max direct memory value.
    • hasUnsafe

      static boolean hasUnsafe()
    • getUnsafeUnavailabilityCause

      static Throwable getUnsafeUnavailabilityCause()
    • unalignedAccess

      static boolean unalignedAccess()
    • throwException

      static void throwException(Throwable cause)
    • hasDirectBufferNoCleanerConstructor

      static boolean hasDirectBufferNoCleanerConstructor()
    • reallocateDirectNoCleaner

      static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity)
    • allocateDirectNoCleaner

      static ByteBuffer allocateDirectNoCleaner(int capacity)
    • hasAlignSliceMethod

      static boolean hasAlignSliceMethod()
    • alignSlice

      static ByteBuffer alignSlice(ByteBuffer buffer, int alignment)
    • hasAllocateArrayMethod

      static boolean hasAllocateArrayMethod()
    • allocateUninitializedArray

      static byte[] allocateUninitializedArray(int size)
    • newDirectBuffer

      static ByteBuffer newDirectBuffer(long address, int capacity)
    • directBufferAddress

      static long directBufferAddress(ByteBuffer buffer)
    • byteArrayBaseOffset

      static long byteArrayBaseOffset()
    • getObject

      static Object getObject(Object object, long fieldOffset)
    • getInt

      static int getInt(Object object, long fieldOffset)
    • safeConstructPutInt

      static void safeConstructPutInt(Object object, long fieldOffset, int value)
    • getLong

      private static long getLong(Object object, long fieldOffset)
    • objectFieldOffset

      static long objectFieldOffset(Field field)
    • getByte

      static byte getByte(long address)
    • getShort

      static short getShort(long address)
    • getInt

      static int getInt(long address)
    • getLong

      static long getLong(long address)
    • getByte

      static byte getByte(byte[] data, int index)
    • getByte

      static byte getByte(byte[] data, long index)
    • getShort

      static short getShort(byte[] data, int index)
    • getInt

      static int getInt(byte[] data, int index)
    • getInt

      static int getInt(int[] data, long index)
    • getIntVolatile

      static int getIntVolatile(long address)
    • putIntOrdered

      static void putIntOrdered(long adddress, int newValue)
    • getLong

      static long getLong(byte[] data, int index)
    • getLong

      static long getLong(long[] data, long index)
    • putByte

      static void putByte(long address, byte value)
    • putShort

      static void putShort(long address, short value)
    • putInt

      static void putInt(long address, int value)
    • putLong

      static void putLong(long address, long value)
    • putByte

      static void putByte(byte[] data, int index, byte value)
    • putByte

      static void putByte(Object data, long offset, byte value)
    • putShort

      static void putShort(byte[] data, int index, short value)
    • putInt

      static void putInt(byte[] data, int index, int value)
    • putLong

      static void putLong(byte[] data, int index, long value)
    • putObject

      static void putObject(Object o, long offset, Object x)
    • copyMemory

      static void copyMemory(long srcAddr, long dstAddr, long length)
    • copyMemoryWithSafePointPolling

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

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

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

      static void setMemory(long address, long bytes, byte value)
    • setMemory

      static void setMemory(Object o, long offset, long bytes, byte value)
    • equals

      static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
    • equalsConstantTime

      static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
    • isZero

      static boolean isZero(byte[] bytes, int startPos, int length)
    • hashCodeAscii

      static int hashCodeAscii(byte[] bytes, int startPos, int length)
    • hashCodeAsciiCompute

      static int hashCodeAsciiCompute(long value, int hash)
    • hashCodeAsciiSanitize

      static int hashCodeAsciiSanitize(int value)
    • hashCodeAsciiSanitize

      static int hashCodeAsciiSanitize(short value)
    • hashCodeAsciiSanitize

      static int hashCodeAsciiSanitize(byte value)
    • getClassLoader

      static ClassLoader getClassLoader(Class<?> clazz)
    • getContextClassLoader

      static ClassLoader getContextClassLoader()
    • getSystemClassLoader

      static ClassLoader getSystemClassLoader()
    • addressSize

      static int addressSize()
    • allocateMemory

      static long allocateMemory(long size)
    • freeMemory

      static void freeMemory(long address)
    • reallocateMemory

      static long reallocateMemory(long address, long newSize)
    • isAndroid

      static boolean isAndroid()
    • isAndroid0

      private static boolean isAndroid0()
    • explicitTryReflectionSetAccessible0

      private static boolean explicitTryReflectionSetAccessible0()
    • isExplicitTryReflectionSetAccessible

      static boolean isExplicitTryReflectionSetAccessible()
    • javaVersion

      static int javaVersion()
    • javaVersion0

      private static int javaVersion0()
    • majorVersionFromJavaSpecificationVersion

      static int majorVersionFromJavaSpecificationVersion()
    • majorVersion

      static int majorVersion(String javaSpecVersion)