Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8197772

metaspace uses global operator new/delete for gtest testing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • None
    • b03
    • generic
    • generic

      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 fixing JDK-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.

            coleenp Coleen Phillimore
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: