RFR: 8288298: Resolve multiline message parsing ambiguities in UL
Johan Sjölen
jsjolen at openjdk.org
Thu Oct 24 09:14:42 UTC 2024
On Wed, 16 Oct 2024 08:56:01 GMT, Antón Seoane <duke at openjdk.org> wrote:
>> src/hotspot/share/logging/logFileStreamOutput.cpp line 186:
>>
>>> 184: os::free(dupstr);
>>> 185:
>>> 186: return written;
>>
>> I don't think we need to dupstr this, do we? Can't we do the changes in the original string instead?
>
> We would lose the `const`ness of the original string. Intuitively I'm not sure either if a printing function should modify the string passed to it.
>
> In any way, the effect of this PR in performance is really negligible, so "duplicating or not" would be a case of neatness more than optimisation. I'm not sure about what's neater, though, so I'll return the question to you
We'll leave it for future work. It can definitely be done, but is not necessary yet.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21501#discussion_r1803544580
More information about the hotspot-runtime-dev
mailing list