comparison src/share/vm/gc_implementation/g1/heapRegionSet.inline.hpp @ 2432:455328d90876

7029458: G1: Add newly-reclaimed regions to the beginning of the region free list, not the end Summary: What the synopsis says. Reviewed-by: jwilhelm, iveresov, johnc
author tonyp
date Tue, 29 Mar 2011 22:36:16 -0400
parents 1216415d8e35
children fe189d4a44e9
comparison
equal deleted inserted replaced
2431:02f49b66361a 2432:455328d90876
108 proxy_set->update_for_addition(hr); 108 proxy_set->update_for_addition(hr);
109 } 109 }
110 110
111 //////////////////// HeapRegionLinkedList //////////////////// 111 //////////////////// HeapRegionLinkedList ////////////////////
112 112
113 inline void HeapRegionLinkedList::add_as_head(HeapRegion* hr) {
114 hrs_assert_mt_safety_ok(this);
115 assert((length() == 0 && _head == NULL && _tail == NULL) ||
116 (length() > 0 && _head != NULL && _tail != NULL),
117 hrs_ext_msg(this, "invariant"));
118 // add_internal() will verify the region.
119 add_internal(hr);
120
121 // Now link the region.
122 if (_head != NULL) {
123 hr->set_next(_head);
124 } else {
125 _tail = hr;
126 }
127 _head = hr;
128 }
129
113 inline void HeapRegionLinkedList::add_as_tail(HeapRegion* hr) { 130 inline void HeapRegionLinkedList::add_as_tail(HeapRegion* hr) {
114 hrs_assert_mt_safety_ok(this); 131 hrs_assert_mt_safety_ok(this);
115 assert((length() == 0 && _head == NULL && _tail == NULL) || 132 assert((length() == 0 && _head == NULL && _tail == NULL) ||
116 (length() > 0 && _head != NULL && _tail != NULL), 133 (length() > 0 && _head != NULL && _tail != NULL),
117 hrs_ext_msg(this, "invariant")); 134 hrs_ext_msg(this, "invariant"));