--- a/src/hotspot/share/prims/whitebox.cpp Fri Nov 15 20:29:11 2019 +0100
+++ b/src/hotspot/share/prims/whitebox.cpp Fri Nov 15 15:33:34 2019 -0500
@@ -797,6 +797,21 @@
assert(hash_size > 0, "NMT hash_size should be > 0");
return (jint)hash_size;
WB_END
+
+WB_ENTRY(jlong, WB_NMTNewArena(JNIEnv* env, jobject o, jlong init_size))
+ Arena* arena = new (mtTest) Arena(mtTest, size_t(init_size));
+ return (jlong)arena;
+WB_END
+
+WB_ENTRY(void, WB_NMTFreeArena(JNIEnv* env, jobject o, jlong arena))
+ Arena* a = (Arena*)arena;
+ delete a;
+WB_END
+
+WB_ENTRY(void, WB_NMTArenaMalloc(JNIEnv* env, jobject o, jlong arena, jlong size))
+ Arena* a = (Arena*)arena;
+ a->Amalloc(size_t(size));
+WB_END
#endif // INCLUDE_NMT
static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) {
@@ -2244,6 +2259,9 @@
{CC"NMTReleaseMemory", CC"(JJ)V", (void*)&WB_NMTReleaseMemory },
{CC"NMTChangeTrackingLevel", CC"()Z", (void*)&WB_NMTChangeTrackingLevel},
{CC"NMTGetHashSize", CC"()I", (void*)&WB_NMTGetHashSize },
+ {CC"NMTNewArena", CC"(J)J", (void*)&WB_NMTNewArena },
+ {CC"NMTFreeArena", CC"(J)V", (void*)&WB_NMTFreeArena },
+ {CC"NMTArenaMalloc", CC"(JJ)V", (void*)&WB_NMTArenaMalloc },
#endif // INCLUDE_NMT
{CC"deoptimizeFrames", CC"(Z)I", (void*)&WB_DeoptimizeFrames },
{CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },