RFR: 8303150: DCmd framework unnecessarily creates a DCmd instance on registration [v2]
David Holmes
dholmes at openjdk.org
Wed Mar 15 12:30:24 UTC 2023
On Wed, 15 Mar 2023 08:45:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Comment update - Kevin's feedback
>
> src/hotspot/share/services/diagnosticFramework.hpp line 446:
>
>> 444:
>> 445: template <typename T, ENABLE_IF(std::is_base_of<DCmdWithParser, T>::value)>
>> 446: static int get_parsed_num_arguments() {
>
> I don't understand why we need the dynamic allocation here. Should we not be able to call your new static versions of num_arguments for DCmdWithParser children, like we do for DCmd children above? And if so, could we then not unify those two functions?
Thanks for looking at this @tstuefe. The whole point of the parsed version is to ensure the static version doesn't get forgotten or out-of-date.
Just realised the `get_parsed_num_arguments` should also be `ifdef ASSERT`.
-------------
PR: https://git.openjdk.org/jdk/pull/12994
More information about the hotspot-dev
mailing list