]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merging async-call branch changes to HEAD:
authorrousskov <>
Wed, 13 Feb 2008 06:26:36 +0000 (06:26 +0000)
committerrousskov <>
Wed, 13 Feb 2008 06:26:36 +0000 (06:26 +0000)
Added toCbdata() method to deal with multiple inheritence in cbdata-protected
objects. The pointers to the object used by others may not point to the part
of the object with the cbdata magic.

src/cbdata.h

index 1d6ab14810ecd16fcc1af31154208e4170470758..cb4b22a8c86c8da5c8a21b1e5183964b78ea6dcb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cbdata.h,v 1.1 2006/08/21 00:50:41 robertc Exp $
+ * $Id: cbdata.h,v 1.2 2008/02/12 23:26:36 rousskov Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -83,6 +83,7 @@ extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, in
                void operator delete (void *address) { \
                  if (address) cbdataInternalFreeDbg(address,__FILE__,__LINE__); \
                } \
+                void *toCbdata() { return this; } \
        private:
 #else
 #define cbdataAlloc(type) ((type *)cbdataInternalAlloc(CBDATA_##type))
@@ -99,6 +100,7 @@ extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, in
                void operator delete (void *address) { \
                  if (address) cbdataInternalFree(address);\
                } \
+                void *toCbdata() { return this; } \
        private:
 #endif
 #define cbdataReference(var)   (cbdataInternalLock(var), var)