/*
- * $Id: cbdata.cc,v 1.9 1997/11/28 08:01:03 wessels Exp $
+ * $Id: cbdata.cc,v 1.10 1997/11/29 17:00:43 wessels Exp $
*
* DEBUG: section 45 Callback Data Registry
* AUTHOR: Duane Wessels
struct _cbdata *next;
int valid;
int locks;
+#if CBDATA_DEBUG
+ const char *file;
+ int line;
+#endif
} cbdata;
static HASHCMP cbdata_cmp;
}
void
+#if CBDATA_DEBUG
+cbdataAddDbg(void *p, const char *file, int line)
+#else
cbdataAdd(void *p)
+#endif
{
cbdata *c;
assert(p);
c = xcalloc(1, sizeof(cbdata));
c->key = p;
c->valid = 1;
+#if CBDATA_DEBUG
+ c->file = file;
+ c->line = line;
+#endif
hash_join(htable, (hash_link *) c);
cbdataCount++;
}
storeAppendPrintf(sentry, "%d cbdata entries\n", cbdataCount);
for (hptr = hash_first(htable); hptr; hptr = hash_next(htable)) {
c = (cbdata *) hptr;
+#if CBDATA_DEBUG
+ storeAppendPrintf(sentry, "%20p %10s %d locks %s:%d\n",
+ c->key,
+ c->valid ? "VALID" : "NOT VALID",
+ c->locks,
+ c->file, c->line);
+#else
storeAppendPrintf(sentry, "%20p %10s %d locks\n",
c->key,
c->valid ? "VALID" : "NOT VALID",
c->locks);
+#endif
}
}
extern void configFreeMemory(void);
extern void cbdataInit(void);
+#if CBDATA_DEBUG
+extern void cbdataAddDbg(void *p, const char *, int);
+#else
extern void cbdataAdd(void *p);
+#endif
extern void cbdataFree(void *p);
extern void cbdataLock(void *p);
extern void cbdataUnlock(void *p);
/*
- * $Id: squid.h,v 1.135 1997/11/14 04:55:08 wessels Exp $
+ * $Id: squid.h,v 1.136 1997/11/29 17:00:45 wessels Exp $
*
* AUTHOR: Duane Wessels
*
#define LOCAL_ARRAY(type,name,size) static type name[size]
#endif
+#if CBDATA_DEBUG
+#define cbdataAdd(a) cbdataAddDbg(a,__FILE__,__LINE__)
+#endif
+
#ifdef USE_GNUREGEX
#include "GNUregex.h"
#elif HAVE_REGEX_H