Class UnsafeUtil

java.lang.Object
de.tilman_neumann.jml.factor.base.UnsafeUtil

public class UnsafeUtil
extends java.lang.Object
Utility to provide a sun.misc.Unsafe instance and manages native memory.
  • Method Summary

    Modifier and Type Method Description
    static long allocateMemory​(long size)
    Allocate a native memory block.
    static void freeMemory​(long address)
    Release a native memory block.
    static sun.misc.Unsafe getUnsafe()  

    Methods inherited from class java.lang.Object

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

    • getUnsafe

      public static sun.misc.Unsafe getUnsafe()
      Returns:
      the Unsafe
    • allocateMemory

      public static long allocateMemory​(long size)
      Allocate a native memory block.
      Parameters:
      size - desired size
      Returns:
      address
    • freeMemory

      public static void freeMemory​(long address)
      Release a native memory block.
      Parameters:
      address -