On Thu, 20 Apr 2023 06:58:20 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> A possible reason for keeping this `operator new` is to force the use of 
>> null return for oom for this class.
>> If it's removed then we have the option of (perhaps unintentionally) using 
>> the terminating allocator.
>> That doesn't seem like a _strong_ reason to keep it, but someone more 
>> familiar with jvmti stuff might
>> want to weigh in.  If it is kept, then I think it should have a 
>> corresponding `operator delete`, else it at
>> least looks odd.
>
> JVMTI does not abort on OOM it reports an error, so we definitely do not want 
> a terminating allocator!
> 
> jvmtiError
> JvmtiEnv::CreateRawMonitor(const char* name, jrawMonitorID* monitor_ptr) {
>   JvmtiRawMonitor* rmonitor = new JvmtiRawMonitor(name);
>   NULL_CHECK(rmonitor, JVMTI_ERROR_OUT_OF_MEMORY);

The new operator is removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13498#discussion_r1172266527

Reply via email to