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

remove char[] allocation in new String(char[] buf) if buf does not escape

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P2
    • Resolution: Won't Fix
    • Affects Version/s: hs19
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_10

      Description

      For example, the char[] allocation you want to make sure is removed is the copying happening in new String(char[]):

          public static String _printBase64Binary(byte[] input, int offset, int len) {
              char[] buf = new char[((len + 2) / 3) * 4];
              int ptr = _printBase64Binary(input, offset, len, buf, 0);
              assert ptr == buf.length;
              return new String(buf);
          }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                kvn Vladimir Kozlov
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: