Skip to content

Commit

Permalink
8326763: Consolidate print methods in ContiguousSpace
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, gli
  • Loading branch information
albertnetymk committed Feb 28, 2024
1 parent 41242cb commit a93605f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
14 changes: 3 additions & 11 deletions src/hotspot/share/gc/shared/space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,12 @@ void ContiguousSpace::mangle_unused_area_complete() {
}
#endif // NOT_PRODUCT


void ContiguousSpace::print_short() const { print_short_on(tty); }

void ContiguousSpace::print_short_on(outputStream* st) const {
st->print(" space " SIZE_FORMAT "K, %3d%% used", capacity() / K,
(int) ((double) used() * 100 / capacity()));
}

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

void ContiguousSpace::print_on(outputStream* st) const {
print_short_on(st);
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(bottom()), p2i(top()), p2i(end()));
st->print_cr(" space %zuK, %3d%% used [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
capacity() / K, (int) ((double) used() * 100 / capacity()),
p2i(bottom()), p2i(top()), p2i(end()));
}

void ContiguousSpace::verify() const {
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/gc/shared/space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ class ContiguousSpace: public CHeapObj<mtGC> {
size_t free() const { return byte_size(top(), end()); }

void print() const;
virtual void print_on(outputStream* st) const;
void print_short() const;
void print_short_on(outputStream* st) const;
void print_on(outputStream* st) const;

// Initialization.
// "initialize" should be called once on a space, before it is used for
Expand Down

1 comment on commit a93605f

@openjdk-notifier
Copy link

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.