8199752: NMT: Memory allocated by Unsafe.allocateMemory should be tagged as mtOther

Tag memory allocation from Usafe.allocateMemory as external memory allocation

Reviewed-by: coleenp, stuefe
This commit is contained in:
Zhengyu Gu 2018-03-19 08:31:57 -04:00
parent 0f92948d6f
commit d6bd698077
2 changed files with 58 additions and 2 deletions

View file

@ -367,7 +367,7 @@ UNSAFE_ENTRY(jlong, Unsafe_AllocateMemory0(JNIEnv *env, jobject unsafe, jlong si
size_t sz = (size_t)size;
sz = align_up(sz, HeapWordSize);
void* x = os::malloc(sz, mtInternal);
void* x = os::malloc(sz, mtOther);
return addr_to_java(x);
} UNSAFE_END
@ -377,7 +377,7 @@ UNSAFE_ENTRY(jlong, Unsafe_ReallocateMemory0(JNIEnv *env, jobject unsafe, jlong
size_t sz = (size_t)size;
sz = align_up(sz, HeapWordSize);
void* x = os::realloc(p, sz, mtInternal);
void* x = os::realloc(p, sz, mtOther);
return addr_to_java(x);
} UNSAFE_END