/*
- * $Id: util.c,v 1.48 1998/02/27 07:13:53 kostas Exp $
+ * $Id: util.c,v 1.49 1998/02/27 07:24:55 kostas Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
#if MEM_GEN_TRACE
-static FILE *tracefp;
+static FILE *tracefp=NULL;
void
log_trace_init(char *fn)
log_trace_done()
{
fclose(tracefp);
+ tracefp=NULL;
}
#endif
xmalloc_show_trace(p, 1);
#endif
#if MEM_GEN_TRACE
+ if (tracefp)
fprintf(tracefp, "m:%d:%p\n",sz,p);
#endif
return (p);
if (s != NULL)
free(s);
#if MEM_GEN_TRACE
+ if (tracefp)
fprintf(tracefp,"f:%p\n",s);
#endif
}
#endif
free(s);
#if MEM_GEN_TRACE
+ if (tracefp)
fprintf(tracefp,"f:%p\n",s);
#endif
}
xmalloc_show_trace(p, 1);
#endif
#if MEM_GEN_TRACE
+ if (tracefp)
fprintf(tracefp,"c:%d:%d:%p\n", n, sz,p);
#endif
return (p);
/*
- * $Id: main.cc,v 1.228 1998/02/27 05:51:15 kostas Exp $
+ * $Id: main.cc,v 1.229 1998/02/27 07:24:56 kostas Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
int errcount = 0;
int n; /* # of GC'd objects */
time_t loop_delay;
-#if MEM_GEN_TRACE
- log_trace_init("/tmp/squid.alloc");
-#endif
debug_log = stderr;
if (FD_SETSIZE < Squid_MaxFD)
/*
- * $Id: tools.cc,v 1.147 1998/02/06 17:50:27 wessels Exp $
+ * $Id: tools.cc,v 1.148 1998/02/27 07:24:57 kostas Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
#if USE_ASYNC_IO
static void safeunlinkComplete(void *data, int retcode, int errcode);
#endif
+#if MEM_GEN_TRACE
+extern void log_trace_done();
+extern void log_trace_init(char *);
+#endif
void
releaseServerSockets(void)
if (state == 0) {
_db_init(Config.Log.log, "ALL,10");
state = 1;
+#if MEM_GEN_TRACE
+ log_trace_done();
+#endif
} else {
_db_init(Config.Log.log, Config.debugOptions);
state = 0;
+#if MEM_GEN_TRACE
+ log_trace_init("/tmp/squid.alloc");
+#endif
}
#if !HAVE_SIGACTION
signal(sig, sigusr2_handle); /* reinstall */