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

Add global sized operator delete definitions

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      C++14 added global sized operator delete functions:

        void operator delete(void* p, size_t size) throw();
        void operator delete [](void* p, size_t size) throw();

      These functions are replaceable, just like the other allocation and deallocation functions.

      In non-product builds, memory/operator_new.cpp provides replacement definitions that call fatal(), to help prevent forbidden use by HotSpot code. (There is also a link-time check in the build system.)

      To support C++14 we should provide similar definitions for the new sized deallocation functions. Since we're already using C++14 when building with Visual Studio 2017 or later, we ought to provide such definitions now, at least for that platform. And we need them when doing experimental C++14 builds with gcc, else we get -Wsized-deallocation warnings (enabled by the recent addition of -Wextra).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: