src/share/vm/gc_implementation/g1/collectionSetChooser.cpp

changeset 3713
720b6a76dd9d
parent 3667
21595f05bc93
child 3714
f7a8920427a6
     1.1 --- a/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Wed Apr 11 16:18:45 2012 +0200
     1.2 +++ b/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Wed Apr 18 07:21:15 2012 -0400
     1.3 @@ -273,7 +273,7 @@
     1.4    assert(verify(), "CSet chooser verification");
     1.5  }
     1.6  
     1.7 -size_t CollectionSetChooser::calcMinOldCSetLength() {
     1.8 +uint CollectionSetChooser::calcMinOldCSetLength() {
     1.9    // The min old CSet region bound is based on the maximum desired
    1.10    // number of mixed GCs after a cycle. I.e., even if some old regions
    1.11    // look expensive, we should add them to the CSet anyway to make
    1.12 @@ -291,10 +291,10 @@
    1.13    if (result * gc_num < region_num) {
    1.14      result += 1;
    1.15    }
    1.16 -  return result;
    1.17 +  return (uint) result;
    1.18  }
    1.19  
    1.20 -size_t CollectionSetChooser::calcMaxOldCSetLength() {
    1.21 +uint CollectionSetChooser::calcMaxOldCSetLength() {
    1.22    // The max old CSet region bound is based on the threshold expressed
    1.23    // as a percentage of the heap size. I.e., it should bound the
    1.24    // number of old regions added to the CSet irrespective of how many
    1.25 @@ -308,7 +308,7 @@
    1.26    if (100 * result < region_num * perc) {
    1.27      result += 1;
    1.28    }
    1.29 -  return result;
    1.30 +  return (uint) result;
    1.31  }
    1.32  
    1.33  void CollectionSetChooser::addMarkedHeapRegion(HeapRegion* hr) {
    1.34 @@ -321,10 +321,10 @@
    1.35    hr->calc_gc_efficiency();
    1.36  }
    1.37  
    1.38 -void CollectionSetChooser::prepareForAddMarkedHeapRegionsPar(size_t n_regions,
    1.39 -                                                             size_t chunkSize) {
    1.40 +void CollectionSetChooser::prepareForAddMarkedHeapRegionsPar(uint n_regions,
    1.41 +                                                             uint chunkSize) {
    1.42    _first_par_unreserved_idx = 0;
    1.43 -  int n_threads = ParallelGCThreads;
    1.44 +  uint n_threads = (uint) ParallelGCThreads;
    1.45    if (UseDynamicNumberOfGCThreads) {
    1.46      assert(G1CollectedHeap::heap()->workers()->active_workers() > 0,
    1.47        "Should have been set earlier");
    1.48 @@ -335,12 +335,11 @@
    1.49      n_threads = MAX2(G1CollectedHeap::heap()->workers()->active_workers(),
    1.50                       1U);
    1.51    }
    1.52 -  size_t max_waste = n_threads * chunkSize;
    1.53 +  uint max_waste = n_threads * chunkSize;
    1.54    // it should be aligned with respect to chunkSize
    1.55 -  size_t aligned_n_regions =
    1.56 -                     (n_regions + (chunkSize - 1)) / chunkSize * chunkSize;
    1.57 -  assert( aligned_n_regions % chunkSize == 0, "should be aligned" );
    1.58 -  _markedRegions.at_put_grow((int)(aligned_n_regions + max_waste - 1), NULL);
    1.59 +  uint aligned_n_regions = (n_regions + chunkSize - 1) / chunkSize * chunkSize;
    1.60 +  assert(aligned_n_regions % chunkSize == 0, "should be aligned");
    1.61 +  _markedRegions.at_put_grow((int) (aligned_n_regions + max_waste - 1), NULL);
    1.62  }
    1.63  
    1.64  jint CollectionSetChooser::getParMarkedHeapRegionChunk(jint n_regions) {

mercurial