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

Make ByteSize and WordSize typed scoped enums

    XMLWordPrintable

    Details

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

      Description

      The classes ByteSize and WordSize are used to create a typesafe differentiation between values denoting "words" and "bytes".

      The way it works today is that ByteSize (and WordSize) is an int typedef in release builds, and a wrapper class in debug builds. This has the drawback that you can't use these types in overloads, because both types resolve to int in release builds.

      I propose that we change this to with typed scoped enums, and get rid of the release/debug difference.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stefank Stefan Karlsson
              Reporter:
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: