RFR: 8286180: Enable construction of LogStreamImpl from LogMessageImpl [v4]

Johan Sjölén duke at openjdk.java.net
Wed May 18 10:04:48 UTC 2022


On Wed, 18 May 2022 02:18:09 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Johan Sjölén has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Don't use get_ prefix and fix indentation
>
> src/hotspot/share/logging/logStream.hpp line 127:
> 
>> 125:     size_t newcap = align_up(atleast + additional_expansion, additional_expansion);
>> 126:     if (newcap > reasonable_max) {
>> 127:       log_info(logging)("Suspiciously long log line: \"%.100s%s",
> 
> Can we safely log from inside logging code?

Yes. This call never occurs when the backing log is logged to, so there's no risk of double locking (this is technically not "logging code").
This code has also been in the source tree since 2016, so experimentally it seems OK :-). My change moves this inside of `logStream.hpp` and deletes `logStream.cpp` as `LogStreamImpl` is templated.

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

PR: https://git.openjdk.java.net/jdk/pull/8748


More information about the hotspot-runtime-dev mailing list