< prev index next >

src/hotspot/share/memory/allocation.hpp

Print this page




 179 
 180 class StackObj ALLOCATION_SUPER_CLASS_SPEC {
 181  private:
 182   void* operator new(size_t size) throw();
 183   void* operator new [](size_t size) throw();
 184 #ifdef __IBMCPP__
 185  public:
 186 #endif
 187   void  operator delete(void* p);
 188   void  operator delete [](void* p);
 189 };
 190 
 191 // Base class for objects used as value objects.
 192 // Calling new or delete will result in fatal error.
 193 //
 194 // Portability note: Certain compilers (e.g. gcc) will
 195 // always make classes bigger if it has a superclass, even
 196 // if the superclass does not have any virtual methods or
 197 // instance fields. The HotSpot implementation relies on this
 198 // not to happen. So never make a ValueObj class a direct subclass
 199 // of this object, but use the VALUE_OBJ_CLASS_SPEC class instead, e.g.,
 200 // like this:
 201 //
 202 //   class A VALUE_OBJ_CLASS_SPEC {
 203 //     ...
 204 //   }
 205 //
 206 // With gcc and possible other compilers the VALUE_OBJ_CLASS_SPEC can
 207 // be defined as a an empty string "".
 208 //
 209 class _ValueObj {
 210  private:
 211   void* operator new(size_t size) throw();
 212   void  operator delete(void* p);
 213   void* operator new [](size_t size) throw();
 214   void  operator delete [](void* p);
 215 };
 216 
 217 
 218 // Base class for objects stored in Metaspace.
 219 // Calling delete will result in fatal error.
 220 //
 221 // Do not inherit from something with a vptr because this class does
 222 // not introduce one.  This class is used to allocate both shared read-only
 223 // and shared read-write classes.
 224 //
 225 
 226 class ClassLoaderData;




 179 
 180 class StackObj ALLOCATION_SUPER_CLASS_SPEC {
 181  private:
 182   void* operator new(size_t size) throw();
 183   void* operator new [](size_t size) throw();
 184 #ifdef __IBMCPP__
 185  public:
 186 #endif
 187   void  operator delete(void* p);
 188   void  operator delete [](void* p);
 189 };
 190 
 191 // Base class for objects used as value objects.
 192 // Calling new or delete will result in fatal error.
 193 //
 194 // Portability note: Certain compilers (e.g. gcc) will
 195 // always make classes bigger if it has a superclass, even
 196 // if the superclass does not have any virtual methods or
 197 // instance fields. The HotSpot implementation relies on this
 198 // not to happen. So never make a ValueObj class a direct subclass

 199 // like this:
 200 //
 201 //   class A {
 202 //     ...
 203 //   }
 204 //

 205 // be defined as a an empty string "".
 206 //
 207 class _ValueObj {
 208  private:
 209   void* operator new(size_t size) throw();
 210   void  operator delete(void* p);
 211   void* operator new [](size_t size) throw();
 212   void  operator delete [](void* p);
 213 };
 214 
 215 
 216 // Base class for objects stored in Metaspace.
 217 // Calling delete will result in fatal error.
 218 //
 219 // Do not inherit from something with a vptr because this class does
 220 // not introduce one.  This class is used to allocate both shared read-only
 221 // and shared read-write classes.
 222 //
 223 
 224 class ClassLoaderData;


< prev index next >