metaspace.cpp contains the functions setup_chunkmanager_returntests() and teardown_chunkmanager_returntests(), which call global operator new and delete, respectively, to manage a test data structure used for gtest-based testing.
This works because a build for gtest excludes operator_new.o, which in non-product build provides replacements for global operator new &etc that error, in order to catch uses of those functions by HotSpot code.
However, this means there are references to global operator new/delete in libjvm.so, which interferes with fixingJDK-8173070.
One way to fix this might be to change metaspace to also provide a function for getting the size of the test data structure, have the gtest-based test code perform the memory allocation, and have the memory passed to the setup function for placement-new construction.
This works because a build for gtest excludes operator_new.o, which in non-product build provides replacements for global operator new &etc that error, in order to catch uses of those functions by HotSpot code.
However, this means there are references to global operator new/delete in libjvm.so, which interferes with fixing
One way to fix this might be to change metaspace to also provide a function for getting the size of the test data structure, have the gtest-based test code perform the memory allocation, and have the memory passed to the setup function for placement-new construction.
- relates to
-
JDK-8173070 Remove ValueObj class for allocation subclassing for runtime code
-
- Resolved
-