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

Non-local G1MonotonicArenaFreePool::_freelist_pool has non-trivial ctor/dtor

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 20
    • 20
    • hotspot
    • gc
    • b27

    Description

      G1MonotonicArenaFreePool is a class with non-trivial ctor and dtor. G1MonotonicArenaFreePool::_freelist_pool is a variable with static duration of this type. Such a variable is contrary to the HotSpot Style Guide, because it introduces static initialization order issues and destruction on exit issues.

      The Style Guide says:

      * Avoid non-local variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction ordering. HotSpot doesn't generally try to cleanup on exit, and running destructors at exit can also lead to problems.

      Attachments

        Issue Links

          Activity

            People

              iwalulya Ivan Walulya
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: