< prev index next >

src/hotspot/share/adlc/arena.hpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_ADLC_ARENA_HPP
  26 #define SHARE_VM_ADLC_ARENA_HPP
  27 
  28 // All classes in the virtual machine must be subclassed
  29 // by one of the following allocation classes:
  30 //
  31 //
  32 // For objects allocated in the C-heap (managed by: free & malloc).
  33 // - CHeapObj
  34 //
  35 //
  36 // For embedded objects.
  37 // - ValueObj
  38 //
  39 // For classes used as name spaces.
  40 // - AllStatic
  41 //
  42 
  43 class CHeapObj {
  44  public:
  45   void* operator new(size_t size) throw();
  46   void  operator delete(void* p);
  47   void* new_array(size_t size);
  48 };
  49 
  50 
  51 // Base class for objects used as value objects.
  52 // Calling new or delete will result in fatal error.
  53 
  54 class ValueObj {
  55  public:
  56   void* operator new(size_t size) throw();
  57   void operator delete(void* p);
  58 };
  59 
  60 // Base class for classes that constitute name spaces.
  61 
  62 class AllStatic {
  63  public:
  64   void* operator new(size_t size) throw();
  65   void operator delete(void* p);
  66 };
  67 
  68 
  69 //------------------------------Chunk------------------------------------------
  70 // Linked list of raw memory chunks
  71 class Chunk: public CHeapObj {
  72  private:
  73   // This ordinary operator delete is needed even though not used, so the
  74   // below two-argument operator delete will be treated as a placement
  75   // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
  76   void operator delete(void* p);
  77  public:
  78   void* operator new(size_t size, size_t length) throw();




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_ADLC_ARENA_HPP
  26 #define SHARE_VM_ADLC_ARENA_HPP
  27 
  28 // All classes in adlc may be subclassed
  29 // by one of the following allocation classes:
  30 //

  31 // For objects allocated in the C-heap (managed by: free & malloc).
  32 // - CHeapObj
  33 //




  34 // For classes used as name spaces.
  35 // - AllStatic
  36 //
  37 
  38 class CHeapObj {
  39  public:
  40   void* operator new(size_t size) throw();
  41   void  operator delete(void* p);
  42   void* new_array(size_t size);
  43 };
  44 









  45 
  46 // Base class for classes that constitute name spaces.
  47 
  48 class AllStatic {
  49  public:
  50   void* operator new(size_t size) throw();
  51   void operator delete(void* p);
  52 };
  53 
  54 
  55 //------------------------------Chunk------------------------------------------
  56 // Linked list of raw memory chunks
  57 class Chunk: public CHeapObj {
  58  private:
  59   // This ordinary operator delete is needed even though not used, so the
  60   // below two-argument operator delete will be treated as a placement
  61   // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
  62   void operator delete(void* p);
  63  public:
  64   void* operator new(size_t size, size_t length) throw();


< prev index next >