Currently we have:
void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack)
The API is allowing to change the MEMFLAGS when we simply reallocate memory. This API design seems to ask for trouble, but is necessary since it maps into native realloc, so we are allowed to do realloc(NULL), which will behave the same as malloc()
Still, we can do better and assert that "flags" do not change for a particular allocation.
void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack)
The API is allowing to change the MEMFLAGS when we simply reallocate memory. This API design seems to ask for trouble, but is necessary since it maps into native realloc, so we are allowed to do realloc(NULL), which will behave the same as malloc()
Still, we can do better and assert that "flags" do not change for a particular allocation.
- relates to
-
JDK-8297718 Make NMT free:ing protocol more granular
-
- Resolved
-
-
JDK-8301403 Eliminate memory allocations in JVMFlag::printFlags during signal handling
-
- Resolved
-