6730514: assertion failure in mangling code when expanding by 0 bytes

An expansion by 0 bytes was not anticipated when the assertion was composed.

Reviewed-by: jjh, jcoomes, apetrusenko
This commit is contained in:
Jon Masamitsu 2008-07-30 11:54:00 -07:00
parent b8633a3b01
commit 74b3de5c3b
9 changed files with 87 additions and 53 deletions

View file

@ -432,14 +432,16 @@ bool CompactingPermGenGen::grow_by(size_t bytes) {
}
void CompactingPermGenGen::grow_to_reserved() {
bool CompactingPermGenGen::grow_to_reserved() {
// Don't allow _virtual_size to expand into shared spaces.
bool success = false;
if (_virtual_space.uncommitted_size() > _shared_space_size) {
size_t remaining_bytes =
_virtual_space.uncommitted_size() - _shared_space_size;
bool success = OneContigSpaceCardGeneration::grow_by(remaining_bytes);
success = OneContigSpaceCardGeneration::grow_by(remaining_bytes);
DEBUG_ONLY(if (!success) warning("grow to reserved failed");)
}
return success;
}