From 4afc0a9fe92cfac09c72aafd8d1aa7e57e55d51d Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Thu, 24 Sep 2015 02:59:36 -0700 Subject: [PATCH] Cleanup: Migrate StoreEntry to using MEMPROXY_CLASS --- src/Store.h | 6 ++++-- src/store.cc | 18 ------------------ src/tests/stub_store.cc | 6 ------ 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/Store.h b/src/Store.h index 47fe985d0d..5442bc9820 100644 --- a/src/Store.h +++ b/src/Store.h @@ -50,6 +50,8 @@ enum { SwapFilenMax = 0xFFFFFF }; // keep in sync with StoreEntry::swap_filen */ class StoreEntry : public hash_link { +public: + MEMPROXY_CLASS(StoreEntry); public: static DeferredRead::DeferrableRead DeferReader; @@ -184,8 +186,6 @@ public: return false; }; - void *operator new(size_t byteCount); - void operator delete(void *address); void setReleaseFlag(); #if USE_SQUID_ESI @@ -242,6 +242,8 @@ private: bool hasOneOfEtags(const String &reqETags, const bool allowWeakMatch) const; }; +MEMPROXY_CLASS_INLINE(StoreEntry); + std::ostream &operator <<(std::ostream &os, const StoreEntry &e); /// \ingroup StoreAPI diff --git a/src/store.cc b/src/store.cc index 8bc452f8e8..6f525336c9 100644 --- a/src/store.cc +++ b/src/store.cc @@ -144,24 +144,6 @@ Store::unlink (StoreEntry &anEntry) 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 3eb734f3bd..10acd51b3b 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) -- 2.47.2