From 01f01b6f7b8a2f0dbe940bffd567ff2b46732787 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Tue, 3 Jun 2025 15:31:07 +0000 Subject: [PATCH] 8358283: Inconsistent failure mode for MetaspaceObj::operator new(size_t, MemTag) Reviewed-by: kvn, kbarrett --- src/hotspot/share/memory/allocation.cpp | 2 +- src/hotspot/share/memory/allocation.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/memory/allocation.cpp b/src/hotspot/share/memory/allocation.cpp index b01ab4014ed..0d99c1bea68 100644 --- a/src/hotspot/share/memory/allocation.cpp +++ b/src/hotspot/share/memory/allocation.cpp @@ -86,7 +86,7 @@ void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data, } // This is used for allocating training data. We are allocating training data in many cases where a GC cannot be triggered. -void* MetaspaceObj::operator new(size_t size, MemTag flags) throw() { +void* MetaspaceObj::operator new(size_t size, MemTag flags) { void* p = AllocateHeap(size, flags, CALLER_PC); memset(p, 0, size); return p; diff --git a/src/hotspot/share/memory/allocation.hpp b/src/hotspot/share/memory/allocation.hpp index 8cd6e6d4207..9e500135d0b 100644 --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp @@ -358,7 +358,7 @@ class MetaspaceObj { size_t word_size, Type type) throw(); // This is used for allocating training data. We are allocating training data in many cases where a GC cannot be triggered. - void* operator new(size_t size, MemTag flags) throw(); + void* operator new(size_t size, MemTag flags); void operator delete(void* p) = delete; // Declare a *static* method with the same signature in any subclass of MetaspaceObj