2362N/A * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. 2362N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A assert(
num >
1,
"use this only for sequences of length 2 or greater");
0N/A // we found enough space for the humongous object 0N/A // we failed to find enough space for the humongous object 0N/A "bottom should be heap region aligned");
0N/A "end should be heap region aligned");
0N/A "bottom should be included in the region with index 0");
0N/A // We have not allocated any regions so far 0N/A // We have to allocate a new HeapRegion. 0N/A // allocation failed, we bail out and return what we have done so far 0N/A // Have to increment the length first, otherwise we will get an 0N/A // assert failure at(index) below. 0N/A assert(
num >
1,
"use this only for sequences of length 2 or greater");
0N/A err_msg(
"_next_search_index: %u should be valid and <= than %u",
0N/A // Try starting from the beginning. If _next_search_index was 0, 0N/A // no point in doing this again. 0N/A err_msg(
"_next_search_index: %u should be valid and <= than %u",
0N/A // Reset this in case it's currently pointing into the regions that 0N/A // around the loop, i will be the next region to be removed 0N/A assert(i > 0,
"we should never remove all regions");
0N/A // [last_start, end) is the MemRegion that covers the regions we will remove. 0N/A // We should leave the humongous regions where they are. 0N/A // We should stop shrinking if we come across a non-empty region. 0N/A // We will reclaim the HeapRegion. _allocated_length should be 0N/A // covering this index. So, even though we removed the region from 0N/A // the active set by decreasing _length, we still have it 0N/A // available in the future if we need to re-use it. 0N/A assert(i > 0,
"we should never remove all regions");
0N/A err_msg(
"invariant: _length: %u _allocated_length: %u",
0N/A err_msg(
"invariant: _allocated_length: %u _max_length: %u",
0N/A err_msg(
"invariant: _next_search_index: %u _length: %u",
0N/A // Asserts will fire if i is >= _length 0N/A // using assert instead of guarantee here since containing_set() 0N/A // is only available in non-product builds.