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

src/share/vm/memory/metachunk.hpp

Print this page




 122 
 123   Metachunk(size_t word_size , VirtualSpaceNode* container);
 124 
 125   MetaWord* allocate(size_t word_size);
 126 
 127   VirtualSpaceNode* container() const { return _container; }
 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   void mangle();
 143   bool is_tagged_free() { return _is_tagged_free; }
 144   void set_is_tagged_free(bool v) { _is_tagged_free = v; }
 145 #endif


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


 122 
 123   Metachunk(size_t word_size , VirtualSpaceNode* container);
 124 
 125   MetaWord* allocate(size_t word_size);
 126 
 127   VirtualSpaceNode* container() const { return _container; }
 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   NOT_PRODUCT(void mangle();)
 147 
 148   void print_on(outputStream* st) const;
 149   void verify();
 150 };
 151 
 152 // Metablock is the unit of allocation from a Chunk.
 153 //
 154 // A Metablock may be reused by its SpaceManager but are never moved between
 155 // SpaceManagers.  There is no explicit link to the Metachunk
 156 // from which it was allocated.  Metablock may be deallocated and
 157 // put on a freelist but the space is never freed, rather
 158 // the Metachunk it is a part of will be deallocated when it's
 159 // associated class loader is collected.
 160 
 161 class Metablock : public Metabase<Metablock> {
 162   friend class VMStructs;
 163  public:
 164   Metablock(size_t word_size) : Metabase<Metablock>(word_size) {}
 165 };
 166 
src/share/vm/memory/metachunk.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File