mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
7029458: G1: Add newly-reclaimed regions to the beginning of the region free list, not the end
What the synopsis says. Reviewed-by: jwilhelm, iveresov, johnc
This commit is contained in:
parent
c2275649b7
commit
349d820dd1
5 changed files with 69 additions and 4 deletions
|
@ -110,6 +110,23 @@ inline void HeapRegionSet::remove_with_proxy(HeapRegion* hr,
|
|||
|
||||
//////////////////// HeapRegionLinkedList ////////////////////
|
||||
|
||||
inline void HeapRegionLinkedList::add_as_head(HeapRegion* hr) {
|
||||
hrs_assert_mt_safety_ok(this);
|
||||
assert((length() == 0 && _head == NULL && _tail == NULL) ||
|
||||
(length() > 0 && _head != NULL && _tail != NULL),
|
||||
hrs_ext_msg(this, "invariant"));
|
||||
// add_internal() will verify the region.
|
||||
add_internal(hr);
|
||||
|
||||
// Now link the region.
|
||||
if (_head != NULL) {
|
||||
hr->set_next(_head);
|
||||
} else {
|
||||
_tail = hr;
|
||||
}
|
||||
_head = hr;
|
||||
}
|
||||
|
||||
inline void HeapRegionLinkedList::add_as_tail(HeapRegion* hr) {
|
||||
hrs_assert_mt_safety_ok(this);
|
||||
assert((length() == 0 && _head == NULL && _tail == NULL) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue