217
218 curr->set_next(NULL);
219 curr->set_prev(NULL);
220 remove(curr);
221
222 count++;
223 curr = next;
224 }
225
226 assert(count == num_regions,
227 "[%s] count: %u should be == num_regions: %u",
228 name(), count, num_regions);
229 assert(length() + num_regions == old_length,
230 "[%s] new length should be consistent "
231 "new length: %u old length: %u num_regions: %u",
232 name(), length(), old_length, num_regions);
233
234 verify_optional();
235 }
236
237 void FreeRegionList::verify() {
238 // See comment in HeapRegionSetBase::verify() about MT safety and
239 // verification.
240 check_mt_safety();
241
242 // This will also do the basic verification too.
243 verify_start();
244
245 verify_list();
246
247 verify_end();
248 }
249
250 void FreeRegionList::clear() {
251 _length = 0;
252 _head = NULL;
253 _tail = NULL;
254 _last = NULL;
255 }
256
|
217
218 curr->set_next(NULL);
219 curr->set_prev(NULL);
220 remove(curr);
221
222 count++;
223 curr = next;
224 }
225
226 assert(count == num_regions,
227 "[%s] count: %u should be == num_regions: %u",
228 name(), count, num_regions);
229 assert(length() + num_regions == old_length,
230 "[%s] new length should be consistent "
231 "new length: %u old length: %u num_regions: %u",
232 name(), length(), old_length, num_regions);
233
234 verify_optional();
235 }
236
237 uint FreeRegionList::num_of_regions_in_range(uint start, uint end) const {
238 HeapRegion* cur = _head;
239 uint num = 0;
240 while (cur != NULL) {
241 uint index = cur->hrm_index();
242 if (index > end) {
243 break;
244 } else if (index >= start) {
245 num++;
246 }
247 cur = cur->next();
248 }
249 return num;
250 }
251
252 void FreeRegionList::verify() {
253 // See comment in HeapRegionSetBase::verify() about MT safety and
254 // verification.
255 check_mt_safety();
256
257 // This will also do the basic verification too.
258 verify_start();
259
260 verify_list();
261
262 verify_end();
263 }
264
265 void FreeRegionList::clear() {
266 _length = 0;
267 _head = NULL;
268 _tail = NULL;
269 _last = NULL;
270 }
271
|