corda/classpath/avian/Machine.java
Joshua Warner 47a7732a81 add jdk-test target, and fix failures
The intent of this target is to run our test suite against the installed jre.
This should help prevent our VM from diverging in implementation from the jdk.

The remainder of this commit fixes the problems that this exposes.
2013-12-06 15:00:02 -07:00

39 lines
843 B
Java

/* Copyright (c) 2008-2013, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See license.txt for
details. */
package avian;
import sun.misc.Unsafe;
import java.lang.reflect.Field;
public abstract class Machine {
private static final Unsafe unsafe;
static {
Unsafe u;
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
u = (Unsafe)f.get(null);
} catch (Exception e) {
u = null;
}
unsafe = u;
}
public static native void dumpHeap(String outputFile);
public static Unsafe getUnsafe() {
return unsafe;
}
}