< prev index next >

src/share/vm/gc/g1/g1Allocator.hpp

Print this page
rev 8849 : imported patch 8003237-no-wait-for-free-list
rev 8850 : imported patch jon-fast-evac-failure
rev 8851 : imported patch bengt-jon-more-naming
rev 8853 : imported patch mikael-erik-suggestions
rev 8854 : imported patch 8073013-add-detailed-information-about-plab-memory-usage
rev 8855 : imported patch jon-review-statistics
rev 8866 : imported patch 8067339-PLAB-reallocation-might-result-in-failure-to-allocate
rev 8867 : [mq]: bengt-refactoring


 159       result += hr->used();
 160     }
 161     return result;
 162   }
 163 };
 164 
 165 class G1PLAB: public PLAB {
 166 private:
 167   bool _retired;
 168 
 169 public:
 170   G1PLAB(size_t gclab_word_size);
 171   virtual ~G1PLAB() {
 172     guarantee(_retired, "Allocation buffer has not been retired");
 173   }
 174 
 175   // The amount of space in words wasted within the PLAB including
 176   // waste due to refills and alignment.
 177   size_t wasted() const { return _wasted; }
 178 
 179   virtual void set_buf(HeapWord* buf) {
 180     PLAB::set_buf(buf);
 181     _retired = false;
 182   }
 183 
 184   virtual void retire() {
 185     if (_retired) {
 186       return;
 187     }
 188     PLAB::retire();
 189     _retired = true;
 190   }
 191 
 192   virtual void flush_and_retire_stats(PLABStats* stats) {
 193     PLAB::flush_and_retire_stats(stats);
 194     _retired = true;
 195   }
 196 };
 197 
 198 // Manages the PLABs used during garbage collection. Interface for allocation from PLABs.
 199 // Needs to handle multiple contexts, extra alignment in any "survivor" area and some
 200 // statistics.




 159       result += hr->used();
 160     }
 161     return result;
 162   }
 163 };
 164 
 165 class G1PLAB: public PLAB {
 166 private:
 167   bool _retired;
 168 
 169 public:
 170   G1PLAB(size_t gclab_word_size);
 171   virtual ~G1PLAB() {
 172     guarantee(_retired, "Allocation buffer has not been retired");
 173   }
 174 
 175   // The amount of space in words wasted within the PLAB including
 176   // waste due to refills and alignment.
 177   size_t wasted() const { return _wasted; }
 178 
 179   virtual void set_buf(HeapWord* buf, size_t word_size) {
 180     PLAB::set_buf(buf, word_size);
 181     _retired = false;
 182   }
 183 
 184   virtual void retire() {
 185     if (_retired) {
 186       return;
 187     }
 188     PLAB::retire();
 189     _retired = true;
 190   }
 191 
 192   virtual void flush_and_retire_stats(PLABStats* stats) {
 193     PLAB::flush_and_retire_stats(stats);
 194     _retired = true;
 195   }
 196 };
 197 
 198 // Manages the PLABs used during garbage collection. Interface for allocation from PLABs.
 199 // Needs to handle multiple contexts, extra alignment in any "survivor" area and some
 200 // statistics.


< prev index next >