Skip to content
Permalink
Browse files
8268520: VirtualSpace::print_on() should be const
Reviewed-by: kbarrett, stuefe, tschatzl
  • Loading branch information
iklam committed Jun 14, 2021
1 parent 1ba4e0c commit ba601b8407c6d56e48b57a9524a11bb275e08adc
Showing 3 changed files with 5 additions and 6 deletions.
@@ -293,8 +293,7 @@ void EpsilonHeap::object_iterate(ObjectClosure *cl) {
void EpsilonHeap::print_on(outputStream *st) const {
st->print_cr("Epsilon Heap");

// Cast away constness:
((VirtualSpace)_virtual_space).print_on(st);
_virtual_space.print_on(st);

if (_space != NULL) {
st->print_cr("Allocation space:");
@@ -1036,7 +1036,7 @@ void VirtualSpace::check_for_contiguity() {
assert(high() <= upper_high(), "upper high");
}

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

void VirtualSpace::print() {
void VirtualSpace::print() const {
print_on(tty);
}

@@ -240,8 +240,8 @@ class VirtualSpace {
void check_for_contiguity() PRODUCT_RETURN;

// Debugging
void print_on(outputStream* out) PRODUCT_RETURN;
void print();
void print_on(outputStream* out) const PRODUCT_RETURN;
void print() const;
};

#endif // SHARE_MEMORY_VIRTUALSPACE_HPP

1 comment on commit ba601b8

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ba601b8 Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.