From: Francesco Chemolli Date: Mon, 21 Sep 2015 14:02:38 +0000 (+0200) Subject: Cleanup: Migrate StoreEntry to using MEMPROXY_CLASS X-Git-Tag: SQUID_4_0_1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91574db515a2c47b9792c136053ed40691dfec34;p=thirdparty%2Fsquid.git Cleanup: Migrate StoreEntry to using MEMPROXY_CLASS --- diff --git a/src/Store.h b/src/Store.h index c147160bc3..d69134eb85 100644 --- a/src/Store.h +++ b/src/Store.h @@ -44,6 +44,7 @@ enum { SwapFilenMax = 0xFFFFFF }; // keep in sync with StoreEntry::swap_filen class StoreEntry : public hash_link, public Packable { + MEMPROXY_CLASS(StoreEntry); public: static DeferredRead::DeferrableRead DeferReader; @@ -178,8 +179,6 @@ public: return false; }; - void *operator new(size_t byteCount); - void operator delete(void *address); void setReleaseFlag(); #if USE_SQUID_ESI diff --git a/src/store.cc b/src/store.cc index 3e04c45b50..168a15ac61 100644 --- a/src/store.cc +++ b/src/store.cc @@ -149,24 +149,6 @@ Store::unlink(StoreEntry &) fatal("Store::unlink on invalid Store\n"); } -void * -StoreEntry::operator new (size_t bytecount) -{ - assert(bytecount == sizeof (StoreEntry)); - - if (!pool) { - pool = memPoolCreate ("StoreEntry", bytecount); - } - - return pool->alloc(); -} - -void -StoreEntry::operator delete (void *address) -{ - pool->freeOne(address); -} - void StoreEntry::makePublic() { diff --git a/src/tests/stub_store.cc b/src/tests/stub_store.cc index b6713a8e9f..352afde313 100644 --- a/src/tests/stub_store.cc +++ b/src/tests/stub_store.cc @@ -81,12 +81,6 @@ size_t StoreEntry::inUseCount() STUB_RETVAL(0) void StoreEntry::getPublicByRequestMethod(StoreClient * aClient, HttpRequest * request, const HttpRequestMethod& method) STUB void StoreEntry::getPublicByRequest(StoreClient * aClient, HttpRequest * request) STUB void StoreEntry::getPublic(StoreClient * aClient, const char *uri, const HttpRequestMethod& method) STUB -void *StoreEntry::operator new(size_t byteCount) -{ - STUB - return new StoreEntry(); -} -void StoreEntry::operator delete(void *address) STUB void StoreEntry::setReleaseFlag() STUB //#if USE_SQUID_ESI //ESIElement::Pointer StoreEntry::cachedESITree STUB_RETVAL(NULL)