From: Alex Rousskov Date: Sun, 16 May 2021 22:31:30 +0000 (+0000) Subject: Fix --with-valgrind-debug build broken by commit 02f5357 (#822) X-Git-Tag: SQUID_4_16~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4b8ef1fb668bcdc1fd1398d50aab44c4ffe32c9;p=thirdparty%2Fsquid.git Fix --with-valgrind-debug build broken by commit 02f5357 (#822) error: cbdata_htable was not declared in this scope --- diff --git a/src/cbdata.cc b/src/cbdata.cc index a32e579c8e..81054ebf5c 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -90,14 +90,7 @@ public: {} ~cbdata(); - static cbdata *FromUserData(const void *p) { -#if WITH_VALGRIND - return cbdata_htable.at(p); -#else - const auto t = static_cast(p) - offsetof(cbdata, data); - return reinterpret_cast(const_cast(t)); -#endif - } + static cbdata *FromUserData(const void *); int valid; int32_t locks; @@ -168,6 +161,16 @@ cbdata::~cbdata() cbdata_index[type].pool->freeOne(p); } +cbdata * +cbdata::FromUserData(const void *p) { +#if WITH_VALGRIND + return cbdata_htable.at(p); +#else + const auto t = static_cast(p) - offsetof(cbdata, data); + return reinterpret_cast(const_cast(t)); +#endif +} + static void cbdataInternalInitType(cbdata_type type, const char *name, int size) {