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

ZUtils::fill uses std::fill_n

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • hotspot
    • gc
    • b03

      ZUtils::fill uses the C++ Standard Library function std::fill_n, from <algorithm>. Much of the Standard Library, including <algorithm>, is not approved for use in HotSpot code. This is currently the only such use outside of adlc.

      It could be using something from the HotSpot Copy class, except there isn't presently an appropriate function there. Copy::fill_to_words takes a juint value, which could clip the upper part of the value passed to ZUtils::fill. The current API of Copy::fill_to_words is arguably a mistake.

      The simplest thing to do would be to change it to the simple and obvious for-loop.

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

              Created:
              Updated:
              Resolved: