@@ -89,7 +89,7 @@ void G1CollectionSet::init_region_lengths(uint eden_cset_region_length,
8989 _survivor_region_length = survivor_cset_region_length;
9090
9191 assert ((size_t ) young_region_length () == _collection_set_cur_length,
92- " Young region length %u should match collection set length " SIZE_FORMAT , young_region_length (), _collection_set_cur_length);
92+ " Young region length %u should match collection set length %u " , young_region_length (), _collection_set_cur_length);
9393
9494 _old_region_length = 0 ;
9595 free_optional_regions ();
@@ -130,8 +130,8 @@ void G1CollectionSet::add_old_region(HeapRegion* hr) {
130130 assert (!hr->in_collection_set (), " should not already be in the collection set" );
131131 _g1h->register_old_region_with_region_attr (hr);
132132
133+ assert (_collection_set_cur_length < _collection_set_max_length, " Collection set now larger than maximum size." );
133134 _collection_set_regions[_collection_set_cur_length++] = hr->hrm_index ();
134- assert (_collection_set_cur_length <= _collection_set_max_length, " Collection set now larger than maximum size." );
135135
136136 _bytes_used_before += hr->used ();
137137 _recorded_rs_length += hr->rem_set ()->occupied ();
@@ -153,7 +153,7 @@ void G1CollectionSet::start_incremental_building() {
153153 assert (_collection_set_cur_length == 0 , " Collection set must be empty before starting a new collection set." );
154154 assert (_inc_build_state == Inactive, " Precondition" );
155155#ifdef ASSERT
156- for (size_t i = 0 ; i < _collection_set_max_length; i++) {
156+ for (uint i = 0 ; i < _collection_set_max_length; i++) {
157157 _inc_collection_set_stats[i].reset ();
158158 }
159159#endif
@@ -326,15 +326,15 @@ void G1CollectionSet::add_young_region_common(HeapRegion* hr) {
326326
327327 // We use UINT_MAX as "invalid" marker in verification.
328328 assert (_collection_set_cur_length < (UINT_MAX - 1 ),
329- " Collection set is too large with " SIZE_FORMAT " entries" , _collection_set_cur_length);
330- hr->set_young_index_in_cset ((uint) _collection_set_cur_length + 1 );
329+ " Collection set is too large with %u entries" , _collection_set_cur_length);
330+ hr->set_young_index_in_cset (_collection_set_cur_length + 1 );
331331
332+ assert (_collection_set_cur_length < _collection_set_max_length, " Collection set larger than maximum allowed." );
332333 _collection_set_regions[_collection_set_cur_length] = hr->hrm_index ();
333334 // Concurrent readers must observe the store of the value in the array before an
334335 // update to the length field.
335336 OrderAccess::storestore ();
336337 _collection_set_cur_length++;
337- assert (_collection_set_cur_length <= _collection_set_max_length, " Collection set larger than maximum allowed." );
338338}
339339
340340void G1CollectionSet::add_survivor_regions (HeapRegion* hr) {
0 commit comments