From: wessels <> Date: Thu, 28 Mar 1996 13:10:04 +0000 (+0000) Subject: rearrange order of functions X-Git-Tag: SQUID_3_0_PRE1~6347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f43b19b100d88a3ffa0871fd89aa7597289e7f1;p=thirdparty%2Fsquid.git rearrange order of functions --- diff --git a/src/tools.cc b/src/tools.cc index d79dbedb70..f1242c5f14 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,5 +1,5 @@ -/* $Id: tools.cc,v 1.16 1996/03/28 06:02:09 wessels Exp $ */ +/* $Id: tools.cc,v 1.17 1996/03/28 06:10:04 wessels Exp $ */ #include "squid.h" @@ -49,7 +49,48 @@ void print_warranty() puts(dead_msg()); } -int PrintRusage(f, lf) + +static void dumpMallocStats(f) + FILE *f; +{ +#if HAVE_MALLINFO + struct mallinfo mp; + + if (!do_mallinfo) + return; + + mp = mallinfo(); + + fprintf(f, "Malloc Instrumentation via mallinfo(): \n"); + fprintf(f, " total space in arena %d\n", mp.arena); + fprintf(f, " number of ordinary blocks %d\n", mp.ordblks); + fprintf(f, " number of small blocks %d\n", mp.smblks); + fprintf(f, " number of holding blocks %d\n", mp.hblks); + fprintf(f, " space in holding block headers %d\n", mp.hblkhd); + fprintf(f, " space in small blocks in use %d\n", mp.usmblks); + fprintf(f, " space in free blocks %d\n", mp.fsmblks); + fprintf(f, " space in ordinary blocks in use %d\n", mp.uordblks); + fprintf(f, " space in free ordinary blocks %d\n", mp.fordblks); + fprintf(f, " cost of enabling keep option %d\n", mp.keepcost); +#if LNG_MALLINFO + fprintf(f, " max size of small blocks %d\n", mp.mxfast); + fprintf(f, " number of small blocks in a holding block %d\n", + mp.nlblks); + fprintf(f, " small block rounding factor %d\n", mp.grain); + fprintf(f, " space (including overhead) allocated in ord. blks %d\n", + mp.uordbytes); + fprintf(f, " number of ordinary blocks allocated %d\n", + mp.allocated); + fprintf(f, " bytes used in maintaining the free tree %d\n", + mp.treeoverhead); +#endif /* LNG_MALLINFO */ + +#if PRINT_MMAP + mallocmap(); +#endif /* PRINT_MMAP */ +#endif /* HAVE_MALLINFO */ +} +static int PrintRusage(f, lf) void (*f) (); FILE *lf; { @@ -151,47 +192,6 @@ void fatal_dump(message) } -void dumpMallocStats(f) - FILE *f; -{ -#if HAVE_MALLINFO - struct mallinfo mp; - - if (!do_mallinfo) - return; - - mp = mallinfo(); - - fprintf(f, "Malloc Instrumentation via mallinfo(): \n"); - fprintf(f, " total space in arena %d\n", mp.arena); - fprintf(f, " number of ordinary blocks %d\n", mp.ordblks); - fprintf(f, " number of small blocks %d\n", mp.smblks); - fprintf(f, " number of holding blocks %d\n", mp.hblks); - fprintf(f, " space in holding block headers %d\n", mp.hblkhd); - fprintf(f, " space in small blocks in use %d\n", mp.usmblks); - fprintf(f, " space in free blocks %d\n", mp.fsmblks); - fprintf(f, " space in ordinary blocks in use %d\n", mp.uordblks); - fprintf(f, " space in free ordinary blocks %d\n", mp.fordblks); - fprintf(f, " cost of enabling keep option %d\n", mp.keepcost); -#if LNG_MALLINFO - fprintf(f, " max size of small blocks %d\n", mp.mxfast); - fprintf(f, " number of small blocks in a holding block %d\n", - mp.nlblks); - fprintf(f, " small block rounding factor %d\n", mp.grain); - fprintf(f, " space (including overhead) allocated in ord. blks %d\n", - mp.uordbytes); - fprintf(f, " number of ordinary blocks allocated %d\n", - mp.allocated); - fprintf(f, " bytes used in maintaining the free tree %d\n", - mp.treeoverhead); -#endif /* LNG_MALLINFO */ - -#if PRINT_MMAP - mallocmap(); -#endif /* PRINT_MMAP */ -#endif /* HAVE_MALLINFO */ -} - int getHeapSize() { #if HAVE_MALLINFO