Skip to content

Commit 5ad126f

Browse files
author
Kim Barrett
committed
8295012: Arena should not derive from CHeapObj<mtNone>
Reviewed-by: stefank, dholmes
1 parent ab8c136 commit 5ad126f

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

src/hotspot/share/memory/arena.cpp

-23
Original file line numberDiff line numberDiff line change
@@ -271,29 +271,6 @@ Arena::~Arena() {
271271
MemTracker::record_arena_free(_flags);
272272
}
273273

274-
void* Arena::operator new(size_t size) throw() {
275-
assert(false, "Use dynamic memory type binding");
276-
return NULL;
277-
}
278-
279-
void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) throw() {
280-
assert(false, "Use dynamic memory type binding");
281-
return NULL;
282-
}
283-
284-
// dynamic memory type binding
285-
void* Arena::operator new(size_t size, MEMFLAGS flags) throw() {
286-
return (void *) AllocateHeap(size, flags, CALLER_PC);
287-
}
288-
289-
void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() {
290-
return (void*)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);
291-
}
292-
293-
void Arena::operator delete(void* p) {
294-
FreeHeap(p);
295-
}
296-
297274
// Destroy this arenas contents and reset to empty
298275
void Arena::destruct_contents() {
299276
if (UseMallocOnly && _first != NULL) {

src/hotspot/share/memory/arena.hpp

+1-10
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Chunk: CHeapObj<mtChunk> {
8686

8787
//------------------------------Arena------------------------------------------
8888
// Fast allocation of memory
89-
class Arena : public CHeapObj<mtNone> {
89+
class Arena : public CHeapObjBase {
9090
protected:
9191
friend class HandleMark;
9292
friend class NoHandleMark;
@@ -121,15 +121,6 @@ class Arena : public CHeapObj<mtNone> {
121121
void destruct_contents();
122122
char* hwm() const { return _hwm; }
123123

124-
// new operators
125-
void* operator new (size_t size) throw();
126-
void* operator new (size_t size, const std::nothrow_t& nothrow_constant) throw();
127-
128-
// dynamic memory type tagging
129-
void* operator new(size_t size, MEMFLAGS flags) throw();
130-
void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw();
131-
void operator delete(void* p);
132-
133124
// Fast allocate in the arena. Common case aligns to the size of jlong which is 64 bits
134125
// on both 32 and 64 bit platforms. Required for atomic jlong operations on 32 bits.
135126
void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {

0 commit comments

Comments
 (0)