221 virtual void clear();
222
223 public:
224 FreeRegionList(const char* name, HRSMtSafeChecker* mt_safety_checker = NULL):
225 HeapRegionSetBase(name, false /* humongous */, true /* empty */, mt_safety_checker) {
226 clear();
227 }
228
229 void verify_list();
230
231 #ifdef ASSERT
232 bool contains(HeapRegion* hr) const {
233 return hr->containing_set() == this;
234 }
235 #endif
236
237 static void set_unrealistically_long_length(uint len);
238
239 // Add hr to the list. The region should not be a member of another set.
240 // Assumes that the list is ordered and will preserve that order. The order
241 // is determined by hrs_index.
242 inline void add_ordered(HeapRegion* hr);
243
244 // Removes from head or tail based on the given argument.
245 HeapRegion* remove_region(bool from_head);
246
247 // Merge two ordered lists. The result is also ordered. The order is
248 // determined by hrs_index.
249 void add_ordered(FreeRegionList* from_list);
250
251 // It empties the list by removing all regions from it.
252 void remove_all();
253
254 // Remove all (contiguous) regions from first to first + num_regions -1 from
255 // this list.
256 // Num_regions must be > 1.
257 void remove_starting_at(HeapRegion* first, uint num_regions);
258
259 virtual void verify();
260
261 virtual void print_on(outputStream* out, bool print_contents = false);
262 };
263
264 // Iterator class that provides a convenient way to iterate over the
265 // regions of a FreeRegionList.
266
267 class FreeRegionListIterator : public StackObj {
268 private:
|
221 virtual void clear();
222
223 public:
224 FreeRegionList(const char* name, HRSMtSafeChecker* mt_safety_checker = NULL):
225 HeapRegionSetBase(name, false /* humongous */, true /* empty */, mt_safety_checker) {
226 clear();
227 }
228
229 void verify_list();
230
231 #ifdef ASSERT
232 bool contains(HeapRegion* hr) const {
233 return hr->containing_set() == this;
234 }
235 #endif
236
237 static void set_unrealistically_long_length(uint len);
238
239 // Add hr to the list. The region should not be a member of another set.
240 // Assumes that the list is ordered and will preserve that order. The order
241 // is determined by hrm_index.
242 inline void add_ordered(HeapRegion* hr);
243
244 // Removes from head or tail based on the given argument.
245 HeapRegion* remove_region(bool from_head);
246
247 // Merge two ordered lists. The result is also ordered. The order is
248 // determined by hrm_index.
249 void add_ordered(FreeRegionList* from_list);
250
251 // It empties the list by removing all regions from it.
252 void remove_all();
253
254 // Remove all (contiguous) regions from first to first + num_regions -1 from
255 // this list.
256 // Num_regions must be > 1.
257 void remove_starting_at(HeapRegion* first, uint num_regions);
258
259 virtual void verify();
260
261 virtual void print_on(outputStream* out, bool print_contents = false);
262 };
263
264 // Iterator class that provides a convenient way to iterate over the
265 // regions of a FreeRegionList.
266
267 class FreeRegionListIterator : public StackObj {
268 private:
|