RFR: 8288298: Resolve multiline message parsing ambiguities in UL [v4]

Antón Seoane duke at openjdk.org
Thu Oct 31 12:44:44 UTC 2024


On Thu, 31 Oct 2024 01:49:25 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> I'm still fine with what we have.
>
>> The JVM IO printing functions need a null terminated string
> 
> No they don't. Instead of using:
> 
> jio_fprintf(_stream, "%s\n", msg)
> 
> you use
> 
> jio_fprintf(_stream, "%*s\n", msg_len, msg)
> 
> So by advancing a cursor to the next newline you can print all the characters prior, since the last print and so step along the string.
> 
> I'm not saying we have to make this change but I do worry that with larger strings the allocation and copying overhead may become an issue.

I just pushed some changes with your suggestion. Even though my performance tests didn't show much of an overhead, if we can avoid copying the string it will be better

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21712#discussion_r1824381006


More information about the hotspot-runtime-dev mailing list