Package io.netty.util.internal
Class CleanerJava24Linker.Holder
- java.lang.Object
-
- io.netty.util.internal.CleanerJava24Linker.Holder
-
- Enclosing class:
- CleanerJava24Linker
private static final class CleanerJava24Linker.Holder extends java.lang.ObjectLinks malloc and free on first use rather than whenPlatformDependentis 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 MethodHandleINVOKE_FREEprivate static MethodHandleINVOKE_MALLOCprivate static longRTLD_DEFAULT_UNSUPPORTED
-
Constructor Summary
Constructors Modifier Constructor Description privateHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidfree(long memoryAddress)(package private) static longmalloc(long size)private static longrtldDefault()The value of theRTLD_DEFAULTpseudo-handle fordlsym(3)on this platform, orRTLD_DEFAULT_UNSUPPORTEDif we do not know it.
-
-
-
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
-
-
Method Detail
-
rtldDefault
private static long rtldDefault()
The value of theRTLD_DEFAULTpseudo-handle fordlsym(3)on this platform, orRTLD_DEFAULT_UNSUPPORTEDif 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 nodlsym.
-
malloc
static long malloc(long size)
-
free
static void free(long memoryAddress)
-
-