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   static const size_t metadata_chunk_initialize = 0xf7f7f7f7;
 150 
 151   void mangle(juint word_value = metadata_chunk_initialize);
 152 #endif
 153 
 154   void print_on(outputStream* st) const;
 155   void verify();
 156 };
 157 
 158 // Metablock is the unit of allocation from a Chunk.
 159 //
 160 // A Metablock may be reused by its SpaceManager but are never moved between
 161 // SpaceManagers.  There is no explicit link to the Metachunk
 162 // from which it was allocated.  Metablock may be deallocated and
 163 // put on a freelist but the space is never freed, rather
 164 // the Metachunk it is a part of will be deallocated when it's
 165 // associated class loader is collected.
 166 
 167 class Metablock : public Metabase<Metablock> {
 168   friend class VMStructs;
 169  public:
 170   Metablock(size_t word_size) : Metabase<Metablock>(word_size) {}
 171 };
 172 
src/share/vm/memory/metachunk.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File