RFR: 8293251: Use stringStream::base() instead of as_string() when applicable

Johan Sjölén duke at openjdk.org
Fri Sep 2 11:30:24 UTC 2022


Hi!

Please review this PR swapping out stringStream::as_string() with ::base() when applicable. With this change we avoid allocating a resource managed string copy. I also attempt to document the base function, as it is not safe to use any result returned from it if you subsequently call the stringStream's methods.

This passes tier1, tier2 tests.

-------------

Commit messages:
 - Attempt to document base()
 - Change out as_string to base where applicable

Changes: https://git.openjdk.org/jdk/pull/10142/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10142&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8293251
  Stats: 69 lines in 27 files changed: 4 ins; 8 del; 57 mod
  Patch: https://git.openjdk.org/jdk/pull/10142.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10142/head:pull/10142

PR: https://git.openjdk.org/jdk/pull/10142


More information about the shenandoah-dev mailing list