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

The return type of MemoryPool::max_size() should be signed

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 10
    • hs18
    • hotspot
    • None
    • svc
    • generic
    • generic

      Right now, the max_size() method of the MemoryPool class (and subclasses) returns size_t. However, according to the specification, -1 is a valid value (it means: undefined). From the javadoc of MemoryUsage.getMax() method:

      ----------

      getMax

      public long getMax()

          Returns the maximum amount of memory in bytes that can be used for memory management. This method returns -1 if the maximum memory size is undefined.

      ...

      ----------

      And the getMax() method is eventually mapped to MemoryPool::max_size().

      Changing the return type of max_size() from size_t to ssize_t would be more reasonable when returning -1 from max_size().

            Unassigned Unassigned
            tonyp Tony Printezis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: