/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
#include "runtime/virtualspace.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "os_solaris.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "os_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "os_bsd.inline.hpp"
#endif
// PSVirtualSpace
{
DEBUG_ONLY(verify());
}
{
DEBUG_ONLY(verify());
}
// Deprecated.
}
// Deprecated.
// Commit to initial size.
DEBUG_ONLY(verify());
return result;
}
PSVirtualSpace::~PSVirtualSpace() {
release();
}
char* const cp = (char*)p;
}
// This may not release memory it didn't reserve.
// Use rs.release() to release the underlying memory instead.
_special = false;
}
if (uncommitted_size() < bytes) {
return false;
}
if (result) {
}
return result;
}
if (committed_size() < bytes) {
return false;
}
if (result) {
}
return result;
}
"spaces not contiguous");
// First use the uncommitted region in this space.
if (tmp_bytes > 0) {
} else {
return 0;
}
}
// Next take from the uncommitted region in the other space, and commit it.
if (tmp_bytes > 0) {
if (other_space->special() ||
// Reduce the reserved region in the other space.
other_space->special());
// Grow both reserved and committed in this space.
} else {
return bytes - bytes_needed;
}
}
// Finally take from the already committed region in the other space.
if (tmp_bytes > 0) {
// Reduce both committed and reserved in the other space.
other_space->special());
// Grow both reserved and committed in this space.
}
return bytes;
}
#ifndef PRODUCT
}
}
}
// Reserved region must be non-empty or both addrs must be 0.
"bad reserved addrs");
if (grows_up()) {
} else {
}
}
SIZE_FORMAT "K grows %s%s",
reserved_size() / K,
committed_size() / K,
}
#endif // #ifndef PRODUCT
}
{
DEBUG_ONLY(verify());
}
DEBUG_ONLY(verify());
}
if (uncommitted_size() < bytes) {
return false;
}
if (result) {
}
return result;
}
if (committed_size() < bytes) {
return false;
}
if (result) {
}
return result;
}
"spaces not contiguous");
// First use the uncommitted region in this space.
if (tmp_bytes > 0) {
} else {
return 0;
}
}
// Next take from the uncommitted region in the other space, and commit it.
if (tmp_bytes > 0) {
if (other_space->special() ||
// Reduce the reserved region in the other space.
other_space->special());
// Grow both reserved and committed in this space.
} else {
return bytes - bytes_needed;
}
}
// Finally take from the already committed region in the other space.
if (tmp_bytes > 0) {
// Reduce both committed and reserved in the other space.
other_space->special());
// Grow both reserved and committed in this space.
}
return bytes;
}
void
}