Class 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.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Holder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void free​(long memoryAddress)  
      (package private) static long malloc​(long size)  
      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.
      • Methods inherited from class java.lang.Object

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

      • RTLD_DEFAULT_UNSUPPORTED

        private static final long RTLD_DEFAULT_UNSUPPORTED
        See Also:
        Constant Field Values
      • INVOKE_MALLOC

        private static final MethodHandle INVOKE_MALLOC
      • INVOKE_FREE

        private static final MethodHandle INVOKE_FREE
    • Constructor Detail

      • Holder

        private Holder()
    • Method Detail

      • 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)