Skip to content

Commit ba601b8

Browse files
committed
8268520: VirtualSpace::print_on() should be const
Reviewed-by: kbarrett, stuefe, tschatzl
1 parent 1ba4e0c commit ba601b8

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/hotspot/share/gc/epsilon/epsilonHeap.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ void EpsilonHeap::object_iterate(ObjectClosure *cl) {
293293
void EpsilonHeap::print_on(outputStream *st) const {
294294
st->print_cr("Epsilon Heap");
295295

296-
// Cast away constness:
297-
((VirtualSpace)_virtual_space).print_on(st);
296+
_virtual_space.print_on(st);
298297

299298
if (_space != NULL) {
300299
st->print_cr("Allocation space:");

src/hotspot/share/memory/virtualspace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void VirtualSpace::check_for_contiguity() {
10361036
assert(high() <= upper_high(), "upper high");
10371037
}
10381038

1039-
void VirtualSpace::print_on(outputStream* out) {
1039+
void VirtualSpace::print_on(outputStream* out) const {
10401040
out->print ("Virtual space:");
10411041
if (special()) out->print(" (pinned in memory)");
10421042
out->cr();
@@ -1046,7 +1046,7 @@ void VirtualSpace::print_on(outputStream* out) {
10461046
out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]", p2i(low_boundary()), p2i(high_boundary()));
10471047
}
10481048

1049-
void VirtualSpace::print() {
1049+
void VirtualSpace::print() const {
10501050
print_on(tty);
10511051
}
10521052

src/hotspot/share/memory/virtualspace.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ class VirtualSpace {
240240
void check_for_contiguity() PRODUCT_RETURN;
241241

242242
// Debugging
243-
void print_on(outputStream* out) PRODUCT_RETURN;
244-
void print();
243+
void print_on(outputStream* out) const PRODUCT_RETURN;
244+
void print() const;
245245
};
246246

247247
#endif // SHARE_MEMORY_VIRTUALSPACE_HPP

0 commit comments

Comments
 (0)