From: Henrik Nordstrom Date: Sat, 29 May 2010 01:19:53 +0000 (+0200) Subject: Blank out memory chunk statistics when not using chunked allocator X-Git-Tag: SQUID_3_2_0_1~179^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=333c86f5df6ecb49f5024729d1236cf474a21668;p=thirdparty%2Fsquid.git Blank out memory chunk statistics when not using chunked allocator --- diff --git a/src/mem.cc b/src/mem.cc index 43b3290a27..75cfd2d27f 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -587,23 +587,31 @@ Mem::PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, std:: stream << std::setw(4) << std::right << mp_st->obj_size << delim; /* Chunks */ - stream << std::setw(4) << toKB(mp_st->obj_size * mp_st->chunk_capacity) << delim; - stream << std::setw(4) << mp_st->chunk_capacity << delim; - if (mp_st->chunk_capacity) { + stream << std::setw(4) << toKB(mp_st->obj_size * mp_st->chunk_capacity) << delim; + stream << std::setw(4) << mp_st->chunk_capacity << delim; + needed = mp_st->items_inuse / mp_st->chunk_capacity; if (mp_st->items_inuse % mp_st->chunk_capacity) needed++; excess = mp_st->chunks_inuse - needed; - } - stream << std::setw(4) << mp_st->chunks_alloc << delim; - stream << std::setw(4) << mp_st->chunks_inuse << delim; - stream << std::setw(4) << mp_st->chunks_free << delim; - stream << std::setw(4) << mp_st->chunks_partial << delim; - stream << std::setprecision(3) << xpercent(excess, needed) << delim; + stream << std::setw(4) << mp_st->chunks_alloc << delim; + stream << std::setw(4) << mp_st->chunks_inuse << delim; + stream << std::setw(4) << mp_st->chunks_free << delim; + stream << std::setw(4) << mp_st->chunks_partial << delim; + stream << std::setprecision(3) << xpercent(excess, needed) << delim; + } else { + stream << delim; + stream << delim; + stream << delim; + stream << delim; + stream << delim; + stream << delim; + stream << delim; + } /* * Fragmentation calculation: * needed = inuse.level / chunk_capacity