src/share/vm/memory/metachunk.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/memory

src/share/vm/memory/metachunk.hpp

Print this page




 128 
 129   MetaWord* bottom() const { return (MetaWord*) this; }
 130 
 131   // Reset top to bottom so chunk can be reused.
 132   void reset_empty() { _top = initial_top(); clear_next(); clear_prev(); }
 133   bool is_empty() { return _top == initial_top(); }
 134 
 135   // used (has been allocated)
 136   // free (available for future allocations)
 137   size_t word_size() const { return size(); }
 138   size_t used_word_size() const;
 139   size_t free_word_size() const;
 140 
 141 #ifdef ASSERT
 142   bool is_tagged_free() { return _is_tagged_free; }
 143   void set_is_tagged_free(bool v) { _is_tagged_free = v; }
 144 #endif
 145 
 146   bool contains(const void* ptr) { return bottom() <= ptr && ptr < _top; }
 147 
 148   NOT_PRODUCT(void mangle();)



 149 
 150   void print_on(outputStream* st) const;
 151   void verify();
 152 };
 153 
 154 // Metablock is the unit of allocation from a Chunk.
 155 //
 156 // A Metablock may be reused by its SpaceManager but are never moved between
 157 // SpaceManagers.  There is no explicit link to the Metachunk
 158 // from which it was allocated.  Metablock may be deallocated and
 159 // put on a freelist but the space is never freed, rather
 160 // the Metachunk it is a part of will be deallocated when it's
 161 // associated class loader is collected.
 162 
 163 class Metablock : public Metabase<Metablock> {
 164   friend class VMStructs;
 165  public:
 166   Metablock(size_t word_size) : Metabase<Metablock>(word_size) {}
 167 };
 168 


 128 
 129   MetaWord* bottom() const { return (MetaWord*) this; }
 130 
 131   // Reset top to bottom so chunk can be reused.
 132   void reset_empty() { _top = initial_top(); clear_next(); clear_prev(); }
 133   bool is_empty() { return _top == initial_top(); }
 134 
 135   // used (has been allocated)
 136   // free (available for future allocations)
 137   size_t word_size() const { return size(); }
 138   size_t used_word_size() const;
 139   size_t free_word_size() const;
 140 
 141 #ifdef ASSERT
 142   bool is_tagged_free() { return _is_tagged_free; }
 143   void set_is_tagged_free(bool v) { _is_tagged_free = v; }
 144 #endif
 145 
 146   bool contains(const void* ptr) { return bottom() <= ptr && ptr < _top; }
 147 
 148 #ifndef PRODUCT
 149   void mangle();
 150   void zap();
 151 #endif // !PRODUCT
 152 
 153   void print_on(outputStream* st) const;
 154   void verify();
 155 };
 156 
 157 // Metablock is the unit of allocation from a Chunk.
 158 //
 159 // A Metablock may be reused by its SpaceManager but are never moved between
 160 // SpaceManagers.  There is no explicit link to the Metachunk
 161 // from which it was allocated.  Metablock may be deallocated and
 162 // put on a freelist but the space is never freed, rather
 163 // the Metachunk it is a part of will be deallocated when it's
 164 // associated class loader is collected.
 165 
 166 class Metablock : public Metabase<Metablock> {
 167   friend class VMStructs;
 168  public:
 169   Metablock(size_t word_size) : Metabase<Metablock>(word_size) {}
 170 };
 171 
src/share/vm/memory/metachunk.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File