mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
Merge pull request #259 from dicej/totalMemory
move Runtime.freeMemory and totalMemory to builtin.cpp
This commit is contained in:
commit
10056734e2
@ -302,6 +302,20 @@ Avian_java_lang_Runtime_exit
|
||||
t->m->system->exit(arguments[1]);
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_java_lang_Runtime_freeMemory
|
||||
(Thread* t, object, uintptr_t*)
|
||||
{
|
||||
return t->m->heap->remaining();
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_java_lang_Runtime_totalMemory
|
||||
(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, object, uintptr_t* arguments)
|
||||
|
@ -571,20 +571,6 @@ Avian_java_lang_Runtime_gc
|
||||
collect(t, Heap::MajorCollection);
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_java_lang_Runtime_freeMemory
|
||||
(Thread* t, object, uintptr_t*)
|
||||
{
|
||||
return t->m->heap->remaining();
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_java_lang_Runtime_totalMemory
|
||||
(Thread* t, object, uintptr_t*)
|
||||
{
|
||||
return t->m->heap->limit();
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT void JNICALL
|
||||
Avian_java_lang_Runtime_addShutdownHook
|
||||
(Thread* t, object, uintptr_t* arguments)
|
||||
|
@ -298,8 +298,14 @@ public class Misc {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
expect(new URL("http://oss.readytalk.com")
|
||||
.getHost().equals("oss.readytalk.com"));
|
||||
// as of this writing, we don't support URLs on Android, since it
|
||||
// pulls in a third-party library we don't include:
|
||||
if (! "http://www.android.com/".equals
|
||||
(System.getProperty("java.vendor.url")))
|
||||
{
|
||||
expect(new URL("http://oss.readytalk.com")
|
||||
.getHost().equals("oss.readytalk.com"));
|
||||
}
|
||||
|
||||
expect(java.util.Arrays.equals
|
||||
(new byte[] { 0, 0, 0, 0 },
|
||||
@ -336,6 +342,9 @@ public class Misc {
|
||||
|
||||
expect(System.getProperty("buzzy.buzzy.bim.bam").equals
|
||||
("yippy yappy yin yang"));
|
||||
|
||||
// just test that it's there; don't care what it returns:
|
||||
Runtime.getRuntime().totalMemory();
|
||||
}
|
||||
|
||||
protected class Protected { }
|
||||
|
Loading…
Reference in New Issue
Block a user