[jdk20] RFR: 8298084: Memory leak in Method::build_profiling_method_data [v2]
Coleen Phillimore
coleenp at openjdk.org
Mon Dec 12 17:21:21 UTC 2022
On Sun, 11 Dec 2022 17:30:55 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix metaprogramming
>
> src/hotspot/share/memory/metadataFactory.hpp line 79:
>
>> 77: // T is a potentially const or volatile qualified pointer. Remove the pointer and any const
>> 78: // or volatile so we can call the destructor of the type T points to.
>> 79: using U = typename RemoveCV<typename RemovePointer<T>::type>::type;
>
> Use `std::remove_pointer<T>` and `std::remove_cv<T>` from `<type_traits>` in
> preference to our pre-C++11/14 workarounds. You can also avoid `typename` and
> `::type` by using the "_t"-suffixed versions. So
>
> using U = std::remove_cv_t<std::remove_pointer_t<T>>;
>
> And "If requested" in the comment? That suggests some conditionalization, of
> which there is none. Maybe something like "Most of the cleanup is done via
> deallocate_contents, but some types require some additional cleanup via the
> destructor."
I fixed this as suggested. Thanks.
-------------
PR: https://git.openjdk.org/jdk20/pull/13
More information about the hotspot-dev
mailing list