From c38a2377979d370531ad676beeaff4d30c1c3751 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 23 Mar 2010 23:21:13 -0600 Subject: [PATCH] Compat: Several compile issues in Profiler and LeakFinder --- include/profiling.h | 5 ++--- src/LeakFinder.cc | 7 ++----- src/LeakFinder.h | 17 +++++++++-------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/profiling.h b/include/profiling.h index 5e617120de..bd9d489c13 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -1,4 +1,3 @@ - #ifndef _PROFILING_H_ #define _PROFILING_H_ @@ -10,9 +9,9 @@ class CacheManager; #endif -#ifdef USE_XPROF_STATS +#if USE_XPROF_STATS -#if !defined(_SQUID_SOLARIS_) +#if !_SQUID_SOLARIS_ typedef int64_t hrtime_t; #else #include diff --git a/src/LeakFinder.cc b/src/LeakFinder.cc index d13a02a107..3f6e1ed957 100644 --- a/src/LeakFinder.cc +++ b/src/LeakFinder.cc @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -69,9 +68,7 @@ LeakFinder::LeakFinder() } void * - -LeakFinder::add -(void *p, const char *file, int line) +LeakFinder::addSome(void *p, const char *file, int line) { assert(hash_lookup(table, p) == NULL); LeakFinderPtr *c = new LeakFinderPtr(p, file, line); @@ -93,7 +90,7 @@ LeakFinder::touch(void *p, const char *file, int line) } void * -LeakFinder::free(void *p, const char *file, int line) +LeakFinder::freeSome(void *p, const char *file, int line) { assert(p); LeakFinderPtr *c = (LeakFinderPtr *) hash_lookup(table, p); diff --git a/src/LeakFinder.h b/src/LeakFinder.h index dfb2ae8423..7d0fc25d66 100644 --- a/src/LeakFinder.h +++ b/src/LeakFinder.h @@ -1,13 +1,15 @@ - - - #ifndef SQUID_LEAKFINDER_H #define SQUID_LEAKFINDER_H +#include "config.h" + #if USE_LEAKFINDER -#define leakAdd(p,l) if (l) l->add(p,__FILE__,__LINE__) + +#include "hash.h" + +#define leakAdd(p,l) if (l) l->addSome(p,__FILE__,__LINE__) #define leakTouch(p,l) if (l) l->touch(p,__FILE__,__LINE__) -#define leakFree(p,l) if (l) l->free(p,__FILE__,__LINE__) +#define leakFree(p,l) if (l) l->freeSome(p,__FILE__,__LINE__) class LeakFinderPtr : public hash_link { @@ -26,12 +28,11 @@ public: LeakFinder(); ~LeakFinder(); - void *add - (void *, const char *, const int); + void *addSome(void *, const char *, const int); void *touch(void *, const char *, const int); - void *free(void *, const char *, const int); + void *freeSome(void *, const char *, const int); void dump(); -- 2.47.2