RFR: 8305590: Remove nothrow exception specifications from operator new [v3]
Afshin Zafari
duke at openjdk.org
Thu Apr 20 08:42:03 UTC 2023
On Tue, 18 Apr 2023 18:25:55 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8305590: Remove nothrow exception specifications from operator new
>
> src/hotspot/share/jfr/utilities/jfrAllocation.hpp line 58:
>
>> 56: NOINLINE void* operator new(size_t size);
>> 57: NOINLINE void* operator new (size_t size, const std::nothrow_t& nothrow_constant) throw();
>> 58: NOINLINE void* operator new [](size_t size);
>
> The changes to JfrCHeapObj are not correct, because these allocators currently _can_ return null.
> Their implementation is just to return the result of calling the non-throwing allocator. That's probably
> not an ideal implementation. Either the declaration needs to be left as-is or the implementation changed.
declaration kept as it is.
> src/hotspot/share/memory/allocation.hpp line 287:
>
>> 285: private:
>> 286: void* operator new(size_t size) throw() = delete;
>> 287: void* operator new [](size_t size) throw() = delete;
>
> The lingering nothrow exception-specs here are just clutter and can be removed.
Done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13498#discussion_r1172265672
PR Review Comment: https://git.openjdk.org/jdk/pull/13498#discussion_r1172265938
More information about the serviceability-dev
mailing list