Class CleanerJava24Linker.Holder

java.lang.Object
io.netty.util.internal.CleanerJava24Linker.Holder
Enclosing class:
CleanerJava24Linker

private static final class CleanerJava24Linker.Holder extends java.lang.Object
Links malloc and free on first use rather than when PlatformDependent is initialized, because creating the downcall handles is a startup cost for applications that may never allocate a direct buffer.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final MethodHandle
     
    private static final MethodHandle
     
    private static final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    free(long memoryAddress)
     
    (package private) static long
    malloc(long size)
     
    private static long
    The value of the RTLD_DEFAULT pseudo-handle for dlsym(3) on this platform, or RTLD_DEFAULT_UNSUPPORTED if we do not know it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RTLD_DEFAULT_UNSUPPORTED

      private static final long RTLD_DEFAULT_UNSUPPORTED
      See Also:
    • INVOKE_MALLOC

      private static final MethodHandle INVOKE_MALLOC
    • INVOKE_FREE

      private static final MethodHandle INVOKE_FREE
  • Constructor Details

    • Holder

      private Holder()
  • Method Details

    • rtldDefault

      private static long rtldDefault()
      The value of the RTLD_DEFAULT pseudo-handle for dlsym(3) on this platform, or RTLD_DEFAULT_UNSUPPORTED if we do not know it. The value is not standardised: glibc and musl use (void*) 0, while macOS and the BSDs use (void*) -2. Windows has no dlsym.
    • malloc

      static long malloc(long size)
    • free

      static void free(long memoryAddress)