Merge pull request #514 from siepkes/runtime-maxfree-support

Added basic support for the Runtime.maxFree() method.
This commit is contained in:
Joshua Warner 2016-12-17 11:27:09 -07:00 committed by GitHub
commit bfc71e3a1e
3 changed files with 9 additions and 0 deletions

View File

@ -129,6 +129,8 @@ public class Runtime {
public native long freeMemory();
public native long totalMemory();
public native long maxMemory();
private static class MyProcess extends Process {
private long pid;

View File

@ -371,6 +371,12 @@ extern "C" AVIAN_EXPORT int64_t JNICALL
return t->m->heap->limit();
}
extern "C" AVIAN_EXPORT int64_t JNICALL
Avian_java_lang_Runtime_maxMemory(Thread* t, object, uintptr_t*)
{
return t->m->heap->limit();
}
extern "C" AVIAN_EXPORT int64_t JNICALL
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_getContentLength(
Thread* t,

View File

@ -360,6 +360,7 @@ public class Misc {
// just test that it's there; don't care what it returns:
Runtime.getRuntime().totalMemory();
Runtime.getRuntime().maxMemory();
}
protected class Protected { }