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

Make ByteSize and WordSize typed scoped enums

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 16
    • 16
    • hotspot
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: