GlueGen: com.jogamp.common.util.UnsafeUtil Class Reference

GlueGen v2.6.0-rc-20250822 GlueGen, Native Binding Generator for Java™ (public API).

Static Public Member Functions | Protected Member Functions | List of all members
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 long | staticFieldOffset (final Field f)
static long | objectFieldOffset (final Field f)
static Object | getObject (final Object o, final long offset)
static void | putObject (final Object o, final long offset, final Object x)
static Object | getObjectVolatile (final Object o, final long offset)
static void | putObjectVolatile (final Object o, final long offset, final Object x)
static long | getLong (final Object o, final long offset)
static void | putLong (final Object o, final long offset, final long x)
static long | getLong (final long address)
static void | putLong (final long address, final long x)
static long | getDirectBufferAddress (final Buffer buffer)
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 46 of file UnsafeUtil.java.

## Constructor & Destructor Documentation

## ◆ UnsafeUtil()

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

protected

Definition at line 53 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

  action | the user action task

Exceptions

  RuntimeException | is thrown for a caught `Throwable` while executing the user `action`

See also
  hasIllegalAccessLoggerAccess()

Definition at line 355 of file UnsafeUtil.java.

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

## ◆ getDirectBufferAddress()

static long com.jogamp.common.util.UnsafeUtil.getDirectBufferAddress | ( | final Buffer | buffer | ) |

static

Definition at line 325 of file UnsafeUtil.java.

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

## ◆ getLong() [1/2]

static long com.jogamp.common.util.UnsafeUtil.getLong | ( | final long | address | ) |

static

Definition at line 318 of file UnsafeUtil.java.

Here is the call graph for this function:

## ◆ getLong() [2/2]

static long com.jogamp.common.util.UnsafeUtil.getLong | ( | final Object | o,
|  | final long | offset
| ) |  |

static

Definition at line 292 of file UnsafeUtil.java.

Here is the caller graph for this function:

## ◆ getObject()

static Object com.jogamp.common.util.UnsafeUtil.getObject | ( | final Object | o,
|  | final long | offset
| ) |  |

static

Definition at line 250 of file UnsafeUtil.java.

## ◆ getObjectVolatile()

static Object com.jogamp.common.util.UnsafeUtil.getObjectVolatile | ( | final Object | o,
|  | final long | offset
| ) |  |

static

Definition at line 271 of file UnsafeUtil.java.

## ◆ 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 340 of file UnsafeUtil.java.

Here is the caller graph for this function:

## ◆ 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 194 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 205 of file UnsafeUtil.java.

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

## ◆ objectFieldOffset()

static long com.jogamp.common.util.UnsafeUtil.objectFieldOffset | ( | final Field | f | ) |

static

Definition at line 235 of file UnsafeUtil.java.

## ◆ putLong() [1/2]

static void com.jogamp.common.util.UnsafeUtil.putLong | ( | final long | address,
|  | final long | x
| ) |  |

static

Definition at line 321 of file UnsafeUtil.java.

Here is the call graph for this function:

## ◆ putLong() [2/2]

static void com.jogamp.common.util.UnsafeUtil.putLong | ( | final Object | o,
|  | final long | offset,
|  | final long | x
| ) |  |

static

Definition at line 306 of file UnsafeUtil.java.

Here is the caller graph for this function:

## ◆ putObject()

static void com.jogamp.common.util.UnsafeUtil.putObject | ( | final Object | o,
|  | final long | offset,
|  | final Object | x
| ) |  |

static

Definition at line 260 of file UnsafeUtil.java.

## ◆ putObjectVolatile()

static void com.jogamp.common.util.UnsafeUtil.putObjectVolatile | ( | final Object | o,
|  | final long | offset,
|  | final Object | x
| ) |  |

static

Definition at line 281 of file UnsafeUtil.java.

## ◆ staticFieldOffset()

static long com.jogamp.common.util.UnsafeUtil.staticFieldOffset | ( | final Field | f | ) |

static

Definition at line 221 of file UnsafeUtil.java.

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

- src/java/com/jogamp/common/util/UnsafeUtil.java