< prev index next >

src/hotspot/share/memory/allocation.cpp

Print this page




  28 #include "memory/allocation.inline.hpp"
  29 #include "memory/arena.hpp"
  30 #include "memory/metaspaceShared.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "memory/universe.hpp"
  33 #include "runtime/atomic.hpp"
  34 #include "runtime/os.hpp"
  35 #include "runtime/task.hpp"
  36 #include "runtime/threadCritical.hpp"
  37 #include "services/memTracker.hpp"
  38 #include "utilities/ostream.hpp"
  39 
  40 void* MetaspaceObj::_shared_metaspace_base = NULL;
  41 void* MetaspaceObj::_shared_metaspace_top  = NULL;
  42 
  43 void* StackObj::operator new(size_t size)     throw() { ShouldNotCallThis(); return 0; }
  44 void  StackObj::operator delete(void* p)              { ShouldNotCallThis(); }
  45 void* StackObj::operator new [](size_t size)  throw() { ShouldNotCallThis(); return 0; }
  46 void  StackObj::operator delete [](void* p)           { ShouldNotCallThis(); }
  47 
  48 void* _ValueObj::operator new(size_t size)    throw() { ShouldNotCallThis(); return 0; }
  49 void  _ValueObj::operator delete(void* p)             { ShouldNotCallThis(); }
  50 void* _ValueObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; }
  51 void  _ValueObj::operator delete [](void* p)          { ShouldNotCallThis(); }
  52 
  53 void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
  54                                  size_t word_size,
  55                                  MetaspaceObj::Type type, TRAPS) throw() {
  56   // Klass has it's own operator new
  57   return Metaspace::allocate(loader_data, word_size, type, THREAD);
  58 }
  59 
  60 bool MetaspaceObj::is_metaspace_object() const {
  61   return Metaspace::contains((void*)this);
  62 }
  63 
  64 void MetaspaceObj::print_address_on(outputStream* st) const {
  65   st->print(" {" INTPTR_FORMAT "}", p2i(this));
  66 }
  67 
  68 void* ResourceObj::operator new(size_t size, Arena *arena) throw() {
  69   address res = (address)arena->Amalloc(size);
  70   DEBUG_ONLY(set_allocation_type(res, ARENA);)
  71   return res;
  72 }




  28 #include "memory/allocation.inline.hpp"
  29 #include "memory/arena.hpp"
  30 #include "memory/metaspaceShared.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "memory/universe.hpp"
  33 #include "runtime/atomic.hpp"
  34 #include "runtime/os.hpp"
  35 #include "runtime/task.hpp"
  36 #include "runtime/threadCritical.hpp"
  37 #include "services/memTracker.hpp"
  38 #include "utilities/ostream.hpp"
  39 
  40 void* MetaspaceObj::_shared_metaspace_base = NULL;
  41 void* MetaspaceObj::_shared_metaspace_top  = NULL;
  42 
  43 void* StackObj::operator new(size_t size)     throw() { ShouldNotCallThis(); return 0; }
  44 void  StackObj::operator delete(void* p)              { ShouldNotCallThis(); }
  45 void* StackObj::operator new [](size_t size)  throw() { ShouldNotCallThis(); return 0; }
  46 void  StackObj::operator delete [](void* p)           { ShouldNotCallThis(); }
  47 





  48 void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
  49                                  size_t word_size,
  50                                  MetaspaceObj::Type type, TRAPS) throw() {
  51   // Klass has it's own operator new
  52   return Metaspace::allocate(loader_data, word_size, type, THREAD);
  53 }
  54 
  55 bool MetaspaceObj::is_metaspace_object() const {
  56   return Metaspace::contains((void*)this);
  57 }
  58 
  59 void MetaspaceObj::print_address_on(outputStream* st) const {
  60   st->print(" {" INTPTR_FORMAT "}", p2i(this));
  61 }
  62 
  63 void* ResourceObj::operator new(size_t size, Arena *arena) throw() {
  64   address res = (address)arena->Amalloc(size);
  65   DEBUG_ONLY(set_allocation_type(res, ARENA);)
  66   return res;
  67 }


< prev index next >