]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: Migrate StoreEntry to using MEMPROXY_CLASS
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 24 Sep 2015 09:59:36 +0000 (02:59 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Sep 2015 09:59:36 +0000 (02:59 -0700)
src/Store.h
src/store.cc
src/tests/stub_store.cc

index 47fe985d0d714cf76c77dfb547be829fd6617db3..5442bc98208a74ae81af08beeb97f6f0b0f0335f 100644 (file)
@@ -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
index 8bc452f8e880b2fa462781efa7e3b289e07f0916..6f525336c942f5d6bf69b3cdef2ebefab05a9a7f 100644 (file)
@@ -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()
 {
index 3eb734f3bdfbf571733092470f699a725dab4f40..10acd51b3bd3f3eff881b537b4b484b867048b00 100644 (file)
@@ -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)