]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Blank out memory chunk statistics when not using chunked allocator
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Sat, 29 May 2010 01:19:53 +0000 (03:19 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Sat, 29 May 2010 01:19:53 +0000 (03:19 +0200)
src/mem.cc

index 43b3290a272329d63db5b516229bc14edcdc00c9..75cfd2d27f9e52ba959ed808f93ee38d3626932f 100644 (file)
@@ -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