RFR: 8292989: Avoid dynamic memory in AsyncLogWriter [v2]
Xin Liu
xliu at openjdk.org
Fri Sep 2 22:54:51 UTC 2022
On Wed, 31 Aug 2022 17:53:24 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> src/hotspot/share/logging/logAsyncWriter.hpp line 98:
>>
>>> 96: bool push_back(const AsyncLogMessage& msg);
>>> 97:
>>> 98: // for testing-only!
>>
>> We typically allow test fixture classes to be declared `friend`s to the classes they test. This allows you to move testing functions to the testing code.
>
> make sense!
I made `AsyncLogWriter::throttle_buffers' private.
I don't think it's necessary to declare `friend class AsyncLogWriter` here in class Buffer. Buffer is a private nested class and we can't construct it outside, so I think it's okay to leave `set_capacity` public here.
-------------
PR: https://git.openjdk.org/jdk/pull/10092
More information about the hotspot-runtime-dev
mailing list