Print this page
rev 2722 : 7095194: G1: HeapRegion::GrainBytes, GrainWords, and CardsPerRegion should be size_t
Summary: Declare GrainBytes, GrainWords, and CardsPerRegion as size_t.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp
↓ open down ↓ 4565 lines elided ↑ open up ↑
4566 4566  
4567 4567    // Print the header of the output.
4568 4568    _out->cr();
4569 4569    _out->print_cr(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now);
4570 4570    _out->print_cr(G1PPRL_LINE_PREFIX" HEAP"
4571 4571                   G1PPRL_SUM_ADDR_FORMAT("committed")
4572 4572                   G1PPRL_SUM_ADDR_FORMAT("reserved")
4573 4573                   G1PPRL_SUM_BYTE_FORMAT("region-size"),
4574 4574                   g1_committed.start(), g1_committed.end(),
4575 4575                   g1_reserved.start(), g1_reserved.end(),
4576      -                 (size_t)HeapRegion::GrainBytes);
     4576 +                 HeapRegion::GrainBytes);
4577 4577    _out->print_cr(G1PPRL_LINE_PREFIX);
4578 4578    _out->print_cr(G1PPRL_LINE_PREFIX
4579 4579                   G1PPRL_TYPE_H_FORMAT
4580 4580                   G1PPRL_ADDR_BASE_H_FORMAT
4581 4581                   G1PPRL_BYTE_H_FORMAT
4582 4582                   G1PPRL_BYTE_H_FORMAT
4583 4583                   G1PPRL_BYTE_H_FORMAT
4584 4584                   G1PPRL_DOUBLE_H_FORMAT,
4585 4585                   "type", "address-range",
4586 4586                   "used", "prev-live", "next-live", "gc-eff");
↓ open down ↓ 10 lines elided ↑ open up ↑
4597 4597  
4598 4598  // It takes as a parameter a reference to one of the _hum_* fields, it
4599 4599  // deduces the corresponding value for a region in a humongous region
4600 4600  // series (either the region size, or what's left if the _hum_* field
4601 4601  // is < the region size), and updates the _hum_* field accordingly.
4602 4602  size_t G1PrintRegionLivenessInfoClosure::get_hum_bytes(size_t* hum_bytes) {
4603 4603    size_t bytes = 0;
4604 4604    // The > 0 check is to deal with the prev and next live bytes which
4605 4605    // could be 0.
4606 4606    if (*hum_bytes > 0) {
4607      -    bytes = MIN2((size_t) HeapRegion::GrainBytes, *hum_bytes);
     4607 +    bytes = MIN2(HeapRegion::GrainBytes, *hum_bytes);
4608 4608      *hum_bytes -= bytes;
4609 4609    }
4610 4610    return bytes;
4611 4611  }
4612 4612  
4613 4613  // It deduces the values for a region in a humongous region series
4614 4614  // from the _hum_* fields and updates those accordingly. It assumes
4615 4615  // that that _hum_* fields have already been set up from the "starts
4616 4616  // humongous" region and we visit the regions in address order.
4617 4617  void G1PrintRegionLivenessInfoClosure::get_hum_bytes(size_t* used_bytes,
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX