8295012: Arena should not derive from CHeapObj<mtNone>
Reviewed-by: stefank, dholmes
This commit is contained in:
parent
ab8c1361bc
commit
5ad126f446
@ -271,29 +271,6 @@ Arena::~Arena() {
|
|||||||
MemTracker::record_arena_free(_flags);
|
MemTracker::record_arena_free(_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* Arena::operator new(size_t size) throw() {
|
|
||||||
assert(false, "Use dynamic memory type binding");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) throw() {
|
|
||||||
assert(false, "Use dynamic memory type binding");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// dynamic memory type binding
|
|
||||||
void* Arena::operator new(size_t size, MEMFLAGS flags) throw() {
|
|
||||||
return (void *) AllocateHeap(size, flags, CALLER_PC);
|
|
||||||
}
|
|
||||||
|
|
||||||
void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() {
|
|
||||||
return (void*)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Arena::operator delete(void* p) {
|
|
||||||
FreeHeap(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Destroy this arenas contents and reset to empty
|
// Destroy this arenas contents and reset to empty
|
||||||
void Arena::destruct_contents() {
|
void Arena::destruct_contents() {
|
||||||
if (UseMallocOnly && _first != NULL) {
|
if (UseMallocOnly && _first != NULL) {
|
||||||
|
@ -86,7 +86,7 @@ class Chunk: CHeapObj<mtChunk> {
|
|||||||
|
|
||||||
//------------------------------Arena------------------------------------------
|
//------------------------------Arena------------------------------------------
|
||||||
// Fast allocation of memory
|
// Fast allocation of memory
|
||||||
class Arena : public CHeapObj<mtNone> {
|
class Arena : public CHeapObjBase {
|
||||||
protected:
|
protected:
|
||||||
friend class HandleMark;
|
friend class HandleMark;
|
||||||
friend class NoHandleMark;
|
friend class NoHandleMark;
|
||||||
@ -121,15 +121,6 @@ protected:
|
|||||||
void destruct_contents();
|
void destruct_contents();
|
||||||
char* hwm() const { return _hwm; }
|
char* hwm() const { return _hwm; }
|
||||||
|
|
||||||
// new operators
|
|
||||||
void* operator new (size_t size) throw();
|
|
||||||
void* operator new (size_t size, const std::nothrow_t& nothrow_constant) throw();
|
|
||||||
|
|
||||||
// dynamic memory type tagging
|
|
||||||
void* operator new(size_t size, MEMFLAGS flags) throw();
|
|
||||||
void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw();
|
|
||||||
void operator delete(void* p);
|
|
||||||
|
|
||||||
// Fast allocate in the arena. Common case aligns to the size of jlong which is 64 bits
|
// Fast allocate in the arena. Common case aligns to the size of jlong which is 64 bits
|
||||||
// on both 32 and 64 bit platforms. Required for atomic jlong operations on 32 bits.
|
// on both 32 and 64 bit platforms. Required for atomic jlong operations on 32 bits.
|
||||||
void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user