From: rousskov <> Date: Wed, 13 Feb 2008 06:26:36 +0000 (+0000) Subject: Merging async-call branch changes to HEAD: X-Git-Tag: BASIC_TPROXY4~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cb3feb5d6114d2cf0f7eb4d97a18d0c69b8e9dc;p=thirdparty%2Fsquid.git Merging async-call branch changes to HEAD: 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. --- diff --git a/src/cbdata.h b/src/cbdata.h index 1d6ab14810..cb4b22a8c8 100644 --- a/src/cbdata.h +++ b/src/cbdata.h @@ -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)