src/hotspot/share/gc/g1/g1MonitoringSupport.hpp
changeset 54467 0c5d713cf43f
parent 53244 9807daeb47c4
equal deleted inserted replaced
54466:58751415d5f8 54467:0c5d713cf43f
   172   size_t _survivor_space_committed;
   172   size_t _survivor_space_committed;
   173   size_t _survivor_space_used;
   173   size_t _survivor_space_used;
   174 
   174 
   175   size_t _old_gen_used;
   175   size_t _old_gen_used;
   176 
   176 
   177   // It returns x - y if x > y, 0 otherwise.
       
   178   // As described in the comment above, some of the inputs to the
       
   179   // calculations we have to do are obtained concurrently and hence
       
   180   // may be inconsistent with each other. So, this provides a
       
   181   // defensive way of performing the subtraction and avoids the value
       
   182   // going negative (which would mean a very large result, given that
       
   183   // the parameter are size_t).
       
   184   static size_t subtract_up_to_zero(size_t x, size_t y) {
       
   185     if (x > y) {
       
   186       return x - y;
       
   187     } else {
       
   188       return 0;
       
   189     }
       
   190   }
       
   191 
       
   192   // Recalculate all the sizes.
   177   // Recalculate all the sizes.
   193   void recalculate_sizes();
   178   void recalculate_sizes();
   194 
   179 
   195   void recalculate_eden_size();
   180   void recalculate_eden_size();
   196 
   181