src/hotspot/share/gc/g1/heapRegionManager.hpp
changeset 47885 5caa1d5f74c1
parent 47216 71c04702a3d5
child 48889 216c2aabbf1f
equal deleted inserted replaced
47884:3cfab71d6c81 47885:5caa1d5f74c1
   187   // Return the number of committed free regions in the heap.
   187   // Return the number of committed free regions in the heap.
   188   uint num_free_regions() const {
   188   uint num_free_regions() const {
   189     return _free_list.length();
   189     return _free_list.length();
   190   }
   190   }
   191 
   191 
   192   size_t total_capacity_bytes() const {
   192   size_t total_free_bytes() const {
   193     return num_free_regions() * HeapRegion::GrainBytes;
   193     return num_free_regions() * HeapRegion::GrainBytes;
   194   }
   194   }
   195 
   195 
   196   // Return the number of available (uncommitted) regions.
   196   // Return the number of available (uncommitted) regions.
   197   uint available() const { return max_length() - length(); }
   197   uint available() const { return max_length() - length(); }
   238 
   238 
   239   // Apply blk->doHeapRegion() on all committed regions in address order,
   239   // Apply blk->doHeapRegion() on all committed regions in address order,
   240   // terminating the iteration early if doHeapRegion() returns true.
   240   // terminating the iteration early if doHeapRegion() returns true.
   241   void iterate(HeapRegionClosure* blk) const;
   241   void iterate(HeapRegionClosure* blk) const;
   242 
   242 
   243   void par_iterate(HeapRegionClosure* blk, uint worker_id, HeapRegionClaimer* hrclaimer) const;
   243   void par_iterate(HeapRegionClosure* blk, HeapRegionClaimer* hrclaimer, const uint start_index) const;
   244 
   244 
   245   // Uncommit up to num_regions_to_remove regions that are completely free.
   245   // Uncommit up to num_regions_to_remove regions that are completely free.
   246   // Return the actual number of uncommitted regions.
   246   // Return the actual number of uncommitted regions.
   247   uint shrink_by(uint num_regions_to_remove);
   247   uint shrink_by(uint num_regions_to_remove);
   248 
   248 
   272 
   272 
   273   inline uint n_regions() const {
   273   inline uint n_regions() const {
   274     return _n_regions;
   274     return _n_regions;
   275   }
   275   }
   276 
   276 
   277   // Calculate the starting region for given worker so
   277   // Return a start offset given a worker id.
   278   // that they do not all start from the same region.
   278   uint offset_for_worker(uint worker_id) const;
   279   uint start_region_for_worker(uint worker_id) const;
       
   280 
   279 
   281   // Check if region has been claimed with this HRClaimer.
   280   // Check if region has been claimed with this HRClaimer.
   282   bool is_region_claimed(uint region_index) const;
   281   bool is_region_claimed(uint region_index) const;
   283 
   282 
   284   // Claim the given region, returns true if successfully claimed.
   283   // Claim the given region, returns true if successfully claimed.