Class UnsafeUtil
- java.lang.Object
-
- de.tilman_neumann.jml.factor.base.UnsafeUtil
-
public class UnsafeUtil extends Object
Utility to provide a sun.misc.Unsafe instance and manages native memory.- Author:
- Tilman Neumann
-
-
Method Summary
All Methods Static Methods Concrete Methods 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()
-
-
-
Method Detail
-
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
-
-
-