GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.UnsafeUtil Class Reference

Utility methods allowing easy access to certain sun.misc.Unsafe functionality. More...

Collaboration diagram for com.jogamp.common.util.UnsafeUtil:

Static Public Member Functions

static boolean hasInvokeCleaner ()
 Returns true if sun.misc.Unsafe.invokeCleaner(java.nio.ByteBuffer) is available and has not caused an exception. More...
 
static boolean invokeCleaner (final ByteBuffer bb)
 Access to sun.misc.Unsafe.invokeCleaner(java.nio.ByteBuffer). More...
 
static boolean hasIllegalAccessLoggerAccess ()
 Returns true if access to jdk.internal.module.IllegalAcessLogger's logger field is available and has not caused an exception. More...
 
static< T > T doWithoutIllegalAccessLogger (final PrivilegedAction< T > action) throws RuntimeException
 Issue the given user action while jdk.internal.module.IllegalAcessLogger's logger has been temporarily disabled. More...
 

Protected Member Functions

 UnsafeUtil ()
 

Detailed Description

Utility methods allowing easy access to certain sun.misc.Unsafe functionality.

Definition at line 44 of file UnsafeUtil.java.

Constructor & Destructor Documentation

◆ UnsafeUtil()

com.jogamp.common.util.UnsafeUtil.UnsafeUtil ( )
protected

Definition at line 51 of file UnsafeUtil.java.

Member Function Documentation

◆ doWithoutIllegalAccessLogger()

static< T > T com.jogamp.common.util.UnsafeUtil.doWithoutIllegalAccessLogger ( final PrivilegedAction< T >  action) throws RuntimeException
static

Issue the given user action while jdk.internal.module.IllegalAcessLogger's logger has been temporarily disabled.

The caller shall place this call into their own SecurityUtil#doPrivileged(PrivilegedAction) block.

In case the runtime is not PlatformPropsImpl#JAVA_9 or the logger is not accessible or disabling caused an exception, the user action is just executed w/o temporary logger modifications.

Parameters
actionthe user action task
Exceptions
RuntimeExceptionis thrown for a caught Throwable while executing the user action
See also
hasIllegalAccessLoggerAccess()

Definition at line 184 of file UnsafeUtil.java.

Here is the call graph for this function:

◆ hasIllegalAccessLoggerAccess()

static boolean com.jogamp.common.util.UnsafeUtil.hasIllegalAccessLoggerAccess ( )
static

Returns true if access to jdk.internal.module.IllegalAcessLogger's logger field is available and has not caused an exception.

See also
#doWithoutIllegalAccessLogger(PrivilegedAction)

Definition at line 169 of file UnsafeUtil.java.

◆ hasInvokeCleaner()

static boolean com.jogamp.common.util.UnsafeUtil.hasInvokeCleaner ( )
static

Returns true if sun.misc.Unsafe.invokeCleaner(java.nio.ByteBuffer) is available and has not caused an exception.

See also
invokeCleaner(ByteBuffer)

Definition at line 137 of file UnsafeUtil.java.

◆ invokeCleaner()

static boolean com.jogamp.common.util.UnsafeUtil.invokeCleaner ( final ByteBuffer  bb)
static

Access to sun.misc.Unsafe.invokeCleaner(java.nio.ByteBuffer).

If b is an direct NIO buffer, i.e sun.nio.ch.DirectBuffer, calls it's sun.misc.Cleaner instance clean() method once.

Returns
true if successful, otherwise false.
See also
hasInvokeCleaner()

Definition at line 148 of file UnsafeUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: