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

GrowableArray should support capacity management

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 20
    • 20
    • hotspot
    • None
    • b21

    Description

      GrowableArray currently supports setting an initial capacity at construction time, and querying the current capacity via max_length(). It does not support functions like reserve and shrink_to_fit provided by std::vector. It's possible to work around that lack, but requires some non-trivial effort. (See StringDedupTable for example.) We should add those functions. those functions. While we're at it, rename max_len to capacity, for consistency with std::vector and to aid discovery by someone familiar with that class.

      Attachments

        Issue Links

          Activity

            People

              kbarrett Kim Barrett
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: