[jdk17u-dev] RFR: 8292989: Avoid dynamic memory in AsyncLogWriter

Xin Liu xliu at openjdk.org
Fri Aug 4 19:07:54 UTC 2023


On Tue, 1 Aug 2023 19:30:35 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> This patch is *NOT* a clean backport.  The logic part is exactly the same, but I have to adjust code in the following parts:
>> 1. change from KVHashtable to ResourceHashtable because we want to use resourceArea instead of C_HEAP. 
>> 2. we added lambda-API iterator() to ResourceHashtable. Instead of backporting all patches from TIP, we just reuse the original iterator(). 
>> 
>> 
>> template<typename Function>
>> void iterate(Function function) const { // lambda enabled API
>> 
>> 
>> Testing: 
>> jdk-test1 tests including gtest. 
>> Manually check there's no malloc/free in runtime.
>
> src/hotspot/share/logging/logAsyncWriter.hpp line 63:
> 
>> 61:   using AsyncLogMap = ResourceHashtable<LogFileStreamOutput*, uint32_t, primitive_hash<LogFileStreamOutput*>,
>> 62:                                         primitive_equals<LogFileStreamOutput*>, 17,
>> 63:                                         ResourceObj::C_HEAP, mtLogging>;
> 
> These arguments should be on the new lines each, I think? This would match the upstream code better.

hi, @shipilev 
Do we have linter rules for this?

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

PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/1630#discussion_r1284752224


More information about the jdk-updates-dev mailing list