src/hotspot/share/memory/allocation.hpp
changeset 53108 e90315ae8aa9
parent 52514 f4e3900c8d08
child 53149 259c36ef27df
equal deleted inserted replaced
53107:cfceb4df2499 53108:e90315ae8aa9
   363   // called but garbage on stack may look like a valid allocation_type.
   363   // called but garbage on stack may look like a valid allocation_type.
   364   // Store negated 'this' pointer when new() is called to distinguish cases.
   364   // Store negated 'this' pointer when new() is called to distinguish cases.
   365   // Use second array's element for verification value to distinguish garbage.
   365   // Use second array's element for verification value to distinguish garbage.
   366   uintptr_t _allocation_t[2];
   366   uintptr_t _allocation_t[2];
   367   bool is_type_set() const;
   367   bool is_type_set() const;
       
   368   void initialize_allocation_info();
   368  public:
   369  public:
   369   allocation_type get_allocation_type() const;
   370   allocation_type get_allocation_type() const;
   370   bool allocated_on_stack()    const { return get_allocation_type() == STACK_OR_EMBEDDED; }
   371   bool allocated_on_stack()    const { return get_allocation_type() == STACK_OR_EMBEDDED; }
   371   bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; }
   372   bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; }
   372   bool allocated_on_C_heap()   const { return get_allocation_type() == C_HEAP; }
   373   bool allocated_on_C_heap()   const { return get_allocation_type() == C_HEAP; }
   373   bool allocated_on_arena()    const { return get_allocation_type() == ARENA; }
   374   bool allocated_on_arena()    const { return get_allocation_type() == ARENA; }
       
   375 protected:
   374   ResourceObj(); // default constructor
   376   ResourceObj(); // default constructor
   375   ResourceObj(const ResourceObj& r); // default copy constructor
   377   ResourceObj(const ResourceObj& r); // default copy constructor
   376   ResourceObj& operator=(const ResourceObj& r); // default copy assignment
   378   ResourceObj& operator=(const ResourceObj& r); // default copy assignment
   377   ~ResourceObj();
   379   ~ResourceObj();
   378 #endif // ASSERT
   380 #endif // ASSERT