hotspot/test/runtime/Unsafe/Reallocate.java
changeset 41092 c388d897472d
parent 40855 3c4c913195e3
equal deleted inserted replaced
41091:de3789bb384e 41092:c388d897472d
    29  * @modules java.base/jdk.internal.misc
    29  * @modules java.base/jdk.internal.misc
    30  *          java.management
    30  *          java.management
    31  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
    31  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
    32  */
    32  */
    33 
    33 
    34 import jdk.test.lib.unsafe.UnsafeHelper;
       
    35 import jdk.internal.misc.Unsafe;
    34 import jdk.internal.misc.Unsafe;
    36 import static jdk.test.lib.Asserts.*;
    35 import static jdk.test.lib.Asserts.*;
    37 
    36 
    38 public class Reallocate {
    37 public class Reallocate {
    39     public static void main(String args[]) throws Exception {
    38     public static void main(String args[]) throws Exception {
    40         Unsafe unsafe = UnsafeHelper.getUnsafe();
    39         Unsafe unsafe = Unsafe.getUnsafe();
    41 
    40 
    42         long address = unsafe.allocateMemory(1);
    41         long address = unsafe.allocateMemory(1);
    43         assertNotEquals(address, 0L);
    42         assertNotEquals(address, 0L);
    44 
    43 
    45         // Make sure we reallocate correctly
    44         // Make sure we reallocate correctly