From: wessels <> Date: Wed, 29 Sep 1999 05:48:46 +0000 (+0000) Subject: Add file and line numbers for CBDATA_DEBUG for cbdataLock and X-Git-Tag: SQUID_3_0_PRE1~2119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7e6c37786bfda16cec9a250b7723e9a91252a09;p=thirdparty%2Fsquid.git Add file and line numbers for CBDATA_DEBUG for cbdataLock and cbdataUnlock. --- diff --git a/src/cbdata.cc b/src/cbdata.cc index 34bcfa8682..ec8d743c53 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -1,6 +1,6 @@ /* - * $Id: cbdata.cc,v 1.27 1998/12/05 00:54:17 wessels Exp $ + * $Id: cbdata.cc,v 1.28 1999/09/28 23:48:46 wessels Exp $ * * DEBUG: section 45 Callback Data Registry * AUTHOR: Duane Wessels @@ -167,7 +167,11 @@ cbdataFree(void *p) } void +#if CBDATA_DEBUG +cbdataLockDbg(const void *p, const char *file, int line) +#else cbdataLock(const void *p) +#endif { cbdata *c; if (p == NULL) @@ -176,10 +180,18 @@ cbdataLock(const void *p) debug(45, 3) ("cbdataLock: %p\n", p); assert(c != NULL); c->locks++; +#if CBDATA_DEBUG + c->file = file; + c->line = line; +#endif } void +#if CBDATA_DEBUG +cbdataUnlockDbg(const void *p, const char *file, int line) +#else cbdataUnlock(const void *p) +#endif { cbdata *c; if (p == NULL) @@ -189,6 +201,10 @@ cbdataUnlock(const void *p) assert(c != NULL); assert(c->locks > 0); c->locks--; +#if CBDATA_DEBUG + c->file = file; + c->line = line; +#endif if (c->valid || c->locks) return; cbdataReallyFree(c); diff --git a/src/protos.h b/src/protos.h index 630239d630..25a67a4972 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.344 1999/08/02 06:18:39 wessels Exp $ + * $Id: protos.h,v 1.345 1999/09/28 23:48:47 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -113,12 +113,14 @@ extern int GetInteger(void); extern void cbdataInit(void); #if CBDATA_DEBUG extern void cbdataAddDbg(const void *p, CBDUNL *, int, const char *, int); +extern void cbdataLockDbg(const void *p, const char *, int); +extern void cbdataUnlockDbg(const void *p, const char *, int); #else extern void cbdataAdd(const void *p, CBDUNL *, int); -#endif -extern void cbdataFree(void *p); extern void cbdataLock(const void *p); extern void cbdataUnlock(const void *p); +#endif +extern void cbdataFree(void *p); extern int cbdataValid(const void *p); extern CBDUNL cbdataXfree; diff --git a/src/squid.h b/src/squid.h index fb8727b9ad..1c42ae6cd1 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.193 1999/06/24 20:20:07 wessels Exp $ + * $Id: squid.h,v 1.194 1999/09/28 23:48:49 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -299,6 +299,8 @@ struct rusage { #if CBDATA_DEBUG #define cbdataAdd(a,b,c) cbdataAddDbg(a,b,c,__FILE__,__LINE__) +#define cbdataLock(a) cbdataLockDbg(a,__FILE__,__LINE__) +#define cbdataUnlock(a) cbdataUnlockDbg(a,__FILE__,__LINE__) #endif #if USE_LEAKFINDER