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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • 10
    • Affects Version/s: hs18
    • Component/s: 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().

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: