7195823: NPG: CMS reserved() doesn't match _rs.base().
Summary: If the commit fails, the size isn't set so the assert fails.
Reviewed-by: kamg
--- a/hotspot/src/share/vm/memory/metaspace.cpp Sat Sep 01 13:25:18 2012 -0400
+++ b/hotspot/src/share/vm/memory/metaspace.cpp Mon Sep 03 18:37:12 2012 -0400
@@ -1077,16 +1077,16 @@
set_top((MetaWord*)virtual_space()->low());
set_reserved(MemRegion((HeapWord*)_rs.base(),
(HeapWord*)(_rs.base() + _rs.size())));
+
+ assert(reserved()->start() == (HeapWord*) _rs.base(),
+ err_msg("Reserved start was not set properly " PTR_FORMAT
+ " != " PTR_FORMAT, reserved()->start(), _rs.base()));
+ assert(reserved()->word_size() == _rs.size() / BytesPerWord,
+ err_msg("Reserved size was not set properly " SIZE_FORMAT
+ " != " SIZE_FORMAT, reserved()->word_size(),
+ _rs.size() / BytesPerWord));
}
- assert(reserved()->start() == (HeapWord*) _rs.base(),
- err_msg("Reserved start was not set properly " PTR_FORMAT
- " != " PTR_FORMAT, reserved()->start(), _rs.base()));
- assert(reserved()->word_size() == _rs.size() / BytesPerWord,
- err_msg("Reserved size was not set properly " SIZE_FORMAT
- " != " SIZE_FORMAT, reserved()->word_size(),
- _rs.size() / BytesPerWord));
-
return result;
}