< prev index next >
src/hotspot/share/gc/shared/taskqueue.cpp
Print this page
rev 56944 : imported patch 8233702-function-to-clamp-value-to-range
*** 55,65 ****
void TaskQueueStats::print_header(unsigned int line, outputStream* const stream,
unsigned int width)
{
// Use a width w: 1 <= w <= max_width
const unsigned int max_width = 40;
! const unsigned int w = MAX2(MIN2(width, max_width), 1U);
if (line == 0) { // spaces equal in width to the header
const unsigned int hdr_width = w * last_stat_id + last_stat_id - 1;
stream->print("%*s", hdr_width, " ");
} else if (line == 1) { // labels
--- 55,65 ----
void TaskQueueStats::print_header(unsigned int line, outputStream* const stream,
unsigned int width)
{
// Use a width w: 1 <= w <= max_width
const unsigned int max_width = 40;
! const unsigned int w = clamp(width, 1u, max_width);
if (line == 0) { // spaces equal in width to the header
const unsigned int hdr_width = w * last_stat_id + last_stat_id - 1;
stream->print("%*s", hdr_width, " ");
} else if (line == 1) { // labels
< prev index next >