< prev index next >
test/runtime/Unsafe/AllocateMemory.java
Print this page
*** 29,45 ****
* @modules java.base/jdk.internal.misc
* java.management
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
*/
- import jdk.test.lib.unsafe.UnsafeHelper;
import jdk.internal.misc.Unsafe;
import static jdk.test.lib.Asserts.*;
public class AllocateMemory {
public static void main(String args[]) throws Exception {
! Unsafe unsafe = UnsafeHelper.getUnsafe();
// Allocate a byte, write to the location and read back the value
long address = unsafe.allocateMemory(1);
assertNotEquals(address, 0L);
--- 29,44 ----
* @modules java.base/jdk.internal.misc
* java.management
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
*/
import jdk.internal.misc.Unsafe;
import static jdk.test.lib.Asserts.*;
public class AllocateMemory {
public static void main(String args[]) throws Exception {
! Unsafe unsafe = Unsafe.getUnsafe();
// Allocate a byte, write to the location and read back the value
long address = unsafe.allocateMemory(1);
assertNotEquals(address, 0L);
< prev index next >