-
Bug
-
Resolution: Fixed
-
P4
-
20
-
b27
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.
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.