src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp
changeset 59249 29b0d0b61615
parent 53725 43854454a7db
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
   110       FREE_C_HEAP_ARRAY(HeapRegion*, _data);
   110       FREE_C_HEAP_ARRAY(HeapRegion*, _data);
   111     }
   111     }
   112 
   112 
   113     // Claim a new chunk, returning its bounds [from, to[.
   113     // Claim a new chunk, returning its bounds [from, to[.
   114     void claim_chunk(uint& from, uint& to) {
   114     void claim_chunk(uint& from, uint& to) {
   115       uint result = Atomic::add(_chunk_size, &_cur_claim_idx);
   115       uint result = Atomic::add(&_cur_claim_idx, _chunk_size);
   116       assert(_max_size > result - 1,
   116       assert(_max_size > result - 1,
   117              "Array too small, is %u should be %u with chunk size %u.",
   117              "Array too small, is %u should be %u with chunk size %u.",
   118              _max_size, result, _chunk_size);
   118              _max_size, result, _chunk_size);
   119       from = result - _chunk_size;
   119       from = result - _chunk_size;
   120       to = result;
   120       to = result;
   212   G1BuildCandidateArray _result;
   212   G1BuildCandidateArray _result;
   213 
   213 
   214   void update_totals(uint num_regions, size_t reclaimable_bytes) {
   214   void update_totals(uint num_regions, size_t reclaimable_bytes) {
   215     if (num_regions > 0) {
   215     if (num_regions > 0) {
   216       assert(reclaimable_bytes > 0, "invariant");
   216       assert(reclaimable_bytes > 0, "invariant");
   217       Atomic::add(num_regions, &_num_regions_added);
   217       Atomic::add(&_num_regions_added, num_regions);
   218       Atomic::add(reclaimable_bytes, &_reclaimable_bytes_added);
   218       Atomic::add(&_reclaimable_bytes_added, reclaimable_bytes);
   219     } else {
   219     } else {
   220       assert(reclaimable_bytes == 0, "invariant");
   220       assert(reclaimable_bytes == 0, "invariant");
   221     }
   221     }
   222   }
   222   }
   223 
   223