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

Make AbstractGangTask stack-allocatable only

XMLWordPrintable

    • gc

      JDK-8214237 introduces a parent class for `AbstractGangTask`, `class AbstractGangTask : public CHeapObj<mtInternal>`, which permits using new/delete operators on `AbstractGangTask`. However, having `AbstractGangTask` heap-allocatable would allow unstructured usage, in contrast to the stack-allocation scheme, which is often easier to follow.

      The only place where new/delete operators are used on `AbstractGangTask` is for creating an instance of `class RestorePreservedMarksTask : public AbstractGangTask`. One can move `RestorePreservedMarksTask` to the header file so that it can be stack-allocated. The downside is that we are exposing `RestorePreservedMarksTask`, but since it's only used in a few places, the impact of such exposure should be minimal.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: