From: kostas <> Date: Fri, 27 Feb 1998 16:07:24 +0000 (+0000) Subject: handling xrealloc added, logging starts by default from main() X-Git-Tag: SQUID_3_0_PRE1~3955 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71a1770210b2cce304f0035b62055f5423d6f921;p=thirdparty%2Fsquid.git handling xrealloc added, logging starts by default from main() --- diff --git a/lib/util.c b/lib/util.c index b1a201cf52..7ec46bd5d1 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.50 1998/02/27 07:29:35 kostas Exp $ + * $Id: util.c,v 1.51 1998/02/27 09:07:25 kostas Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -515,7 +515,7 @@ xfree(void *s) if (s != NULL) free(s); #if MEM_GEN_TRACE - if (tracefp) + if (tracefp && s) fprintf(tracefp,"f:%p\n",s); #endif } @@ -570,6 +570,10 @@ xrealloc(void *s, size_t sz) #endif #if XMALLOC_TRACE xmalloc_show_trace(p, 1); +#endif +#if MEM_GEN_TRACE + if (tracefp) /* new ptr, old ptr, new size */ + fprintf(tracefp, "r:%p:%p:%d\n",p,s,sz); #endif return (p); } diff --git a/src/main.cc b/src/main.cc index 521b4699a1..2243acb55c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.229 1998/02/27 07:24:56 kostas Exp $ + * $Id: main.cc,v 1.230 1998/02/27 09:07:24 kostas Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -429,7 +429,9 @@ mainInitialize(void) _db_init(Config.Log.log, Config.debugOptions); fd_open(fileno(debug_log), FD_LOG, Config.Log.log); - +#if MEM_GEN_TRACE + log_trace_init("/tmp/squid.alloc"); +#endif debug(1, 0) ("Starting Squid Cache version %s for %s...\n", version_string, CONFIG_HOST_TYPE);