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

Make ByteSize and WordSize typed scoped enums

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 16
    • 16
    • hotspot
    • b18

      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.

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

              Created:
              Updated:
              Resolved: