From: robertc <> Date: Tue, 5 Aug 2003 04:14:37 +0000 (+0000) Subject: Summary: Remove the unneeded 'deleteSelf' idiom. X-Git-Tag: SQUID_3_0_PRE3~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00d77d6bb60c405afba0412e87ce6b781e59efc6;p=thirdparty%2Fsquid.git Summary: Remove the unneeded 'deleteSelf' idiom. Keywords: Remove the unneeded 'deleteSelf' idiom. --- diff --git a/include/List.h b/include/List.h index a0884ce3ba..d59e6dfec3 100644 --- a/include/List.h +++ b/include/List.h @@ -1,6 +1,6 @@ /* - * $Id: List.h,v 1.2 2003/03/04 01:40:22 robertc Exp $ + * $Id: List.h,v 1.3 2003/08/04 22:14:37 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -35,31 +35,35 @@ #define SQUID_LIST_H template + class List { public: - void *operator new (size_t); - void operator delete (void *); - void deleteSelf() const; - List (C const &); - ~List(); - - bool find(C const &)const; - bool findAndTune(C const &); - List *next; - C element; + void *operator new (size_t); + void operator delete (void *); + List (C const &); + ~List(); + + bool find(C const &)const; + bool findAndTune(C const &); + List *next; + C element; + private: - CBDATA_CLASS(List); + CBDATA_CLASS(List); #if 0 - static MemPool *Pool; + + static MemPool *Pool; #endif }; template + class ListContainer { - public: + +public: ListContainer(); ~ListContainer(); List *push_back (C const &); @@ -73,6 +77,7 @@ class ListContainer #if 0 template MemPool *List::Pool(NULL); + #endif template cbdata_type List::CBDATA_List = CBDATA_UNKNOWN; @@ -84,12 +89,18 @@ List::operator new (size_t byteCount) #if 0 /* derived classes with different sizes must implement their own new */ assert (byteCount == sizeof (List)); + if (!Pool) - Pool = memPoolCreate("List", sizeof (List)); + Pool = memPoolCreate("List", sizeof (List)); + return memPoolAlloc(Pool); + #endif + CBDATA_INIT_TYPE(List); + List *result = cbdataAlloc(List); + return result; } @@ -102,23 +113,15 @@ List::operator delete (void *address) cbdataFree(address); } -template -void -List::deleteSelf() const -{ - delete this; -} - template List::List(C const &value) : next(NULL), element (value) -{ -} +{} template List::~List() { if (next) - next->deleteSelf(); + delete next; } template @@ -126,9 +129,11 @@ bool List::find (C const &toFind) const { List const *node = NULL; + for (node = this; node; node = node->next) - if (node->element == toFind) - return true; + if (node->element == toFind) + return true; + return false; } @@ -137,32 +142,36 @@ bool List::findAndTune(C const & toFind) { List *prev = NULL; - for (List *node = this; node; node = node->next) { - if (node->element == toFind) { - if (prev != NULL) { - /* shift the element just found to the second position - * in the list */ - prev->next = node->next; - node->next = this->next; - this->next = node; - } - return true; - } - prev = node; + + for (List *node = this; node; node = node-> + next) { + if (node->element == toFind) { + if (prev != NULL) { + /* shift the element just found to the second position + * in the list */ + prev->next = node->next; + node->next = this->next; + this->next = node; + } + + return true; + } + + prev = node; } + return false; } template ListContainer::ListContainer() : head (NULL) -{ -} +{} template ListContainer::~ListContainer() { if (head) - head->deleteSelf(); + delete head; } template @@ -170,34 +179,41 @@ List * ListContainer::push_back (C const &element) { List *node = new List (element); + if (head) { - List *tempNode = NULL; - for (tempNode = head; tempNode->next; tempNode = tempNode->next); - tempNode->next = node; + List *tempNode = NULL; + + for (tempNode = head; tempNode->next; tempNode = tempNode->next) + + ; + tempNode->next = node; } else - head = node; + head = node; + return node; } template -C +C ListContainer::pop_front() { if (head) { - C result = head->element; - List *node = head; - head = head->next; - node->next = NULL; - node->deleteSelf(); - return result; + C result = head->element; + List *node = head; + head = head->next; + node->next = NULL; + delete node; + return result; } + return C(); } template -bool +bool ListContainer::empty() const { return head == NULL; } + #endif /* SQUID_LIST_H */ diff --git a/include/RefCount.h b/include/RefCount.h index 9c63b243e4..0ad052eb4d 100644 --- a/include/RefCount.h +++ b/include/RefCount.h @@ -1,6 +1,6 @@ /* - * $Id: RefCount.h,v 1.7 2003/07/12 23:44:27 robertc Exp $ + * $Id: RefCount.h,v 1.8 2003/08/04 22:14:37 robertc Exp $ * * DEBUG: section xx Refcount allocator * AUTHOR: Robert Collins @@ -92,13 +92,14 @@ private: void dereference(C const *newP = NULL) { /* Setting p_ first is important: - * we may be freed ourselves as a result of - * p_->deleteSelf(); - */ + * we may be freed ourselves as a result of + * delete p_; + */ C const (*tempP_) (p_); - p_ = newP; + p_ = newP; + if (tempP_ && tempP_->RefCountDereference() == 0) - tempP_->deleteSelf(); + delete tempP_; } void reference (const RefCount& p) @@ -117,7 +118,6 @@ struct RefCountable_ virtual ~RefCountable_(){} - virtual void deleteSelf() const = 0; /* Not private, to allow class hierarchies */ void RefCountReference() const { diff --git a/include/splay.h b/include/splay.h index 433c31b315..4159d2416d 100644 --- a/include/splay.h +++ b/include/splay.h @@ -1,5 +1,5 @@ /* - * $Id: splay.h,v 1.21 2003/06/26 12:51:57 robertc Exp $ + * $Id: splay.h,v 1.22 2003/08/04 22:14:37 robertc Exp $ */ #ifndef SQUID_SPLAY_H @@ -42,7 +42,7 @@ public: typedef int SPLAYCMP(Value const &a, Value const &b); typedef void SPLAYFREE(Value &); typedef void SPLAYWALKEE(Value const & nodedata, void *state); - static void DefaultFree (Value &aValue) {aValue->deleteSelf();} + static void DefaultFree (Value &aValue) {delete aValue;} Value data; mutable SplayNode *left; diff --git a/src/ACL.h b/src/ACL.h index f34d478887..f2cb8ff2e9 100644 --- a/src/ACL.h +++ b/src/ACL.h @@ -1,6 +1,6 @@ /* - * $Id: ACL.h,v 1.9 2003/07/06 21:50:55 hno Exp $ + * $Id: ACL.h,v 1.10 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -61,7 +61,6 @@ class ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const = 0; static ACL *Factory (char const *); static void ParseAclLine(acl ** head); @@ -122,7 +121,6 @@ class acl_access public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; bool containsPURGE() const; allow_t allow; acl_list *aclList; @@ -139,7 +137,6 @@ class ACLList public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLList(); void negated(bool isNegated); diff --git a/src/ACLARP.cc b/src/ACLARP.cc index 0f9b1a55f8..86cbd9fd53 100644 --- a/src/ACLARP.cc +++ b/src/ACLARP.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.3 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLARP.cc,v 1.4 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -103,12 +103,6 @@ ACLARP::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLARP::deleteSelf() const -{ - delete this; -} - ACLARP::~ACLARP() { if (data) diff --git a/src/ACLARP.h b/src/ACLARP.h index 642787b3a7..6e6a774203 100644 --- a/src/ACLARP.h +++ b/src/ACLARP.h @@ -1,6 +1,6 @@ /* - * $Id: ACLARP.h,v 1.1 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLARP.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ struct acl_arp_data { char eth[6]; - void deleteSelf() const {delete this;} }; class ACLARP : public ACL @@ -51,7 +50,6 @@ class ACLARP : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLARP(char const *); ACLARP(ACLARP const &); diff --git a/src/ACLASN.h b/src/ACLASN.h index 9eb113cc87..b848ed4c98 100644 --- a/src/ACLASN.h +++ b/src/ACLASN.h @@ -1,6 +1,6 @@ /* - * $Id: ACLASN.h,v 1.3 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLASN.h,v 1.4 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -50,7 +50,6 @@ class ACLASN : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual ~ACLASN(); diff --git a/src/ACLCertificateData.cc b/src/ACLCertificateData.cc index 08405de394..c605fe4034 100644 --- a/src/ACLCertificateData.cc +++ b/src/ACLCertificateData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLCertificateData.cc,v 1.5 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLCertificateData.cc,v 1.6 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -58,13 +58,6 @@ ACLCertificateData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLCertificateData::deleteSelf() const -{ - delete this; -} - - ACLCertificateData::ACLCertificateData(SSLGETATTRIBUTE *sslStrategy) : attribute (NULL), values (), sslAttributeCall (sslStrategy) {} diff --git a/src/ACLCertificateData.h b/src/ACLCertificateData.h index 484209d8bd..e0e62a1b1b 100644 --- a/src/ACLCertificateData.h +++ b/src/ACLCertificateData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLCertificateData.h,v 1.4 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLCertificateData.h,v 1.5 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -47,7 +47,6 @@ class ACLCertificateData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLCertificateData(SSLGETATTRIBUTE *); ACLCertificateData(ACLCertificateData const &); diff --git a/src/ACLChecklist.cc b/src/ACLChecklist.cc index 546dc46df3..12ef5fbf33 100644 --- a/src/ACLChecklist.cc +++ b/src/ACLChecklist.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLChecklist.cc,v 1.13 2003/07/11 01:40:33 robertc Exp $ + * $Id: ACLChecklist.cc,v 1.14 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -232,7 +232,7 @@ ACLChecklist::checkCallback(allow_t answer) if (cbdataReferenceValidDone(callback_data, &cbdata_)) callback_(answer, cbdata_); - deleteSelf(); + delete this; } void @@ -285,12 +285,6 @@ ACLChecklist::operator delete (void *address) cbdataReferenceDone (t); } -void -ACLChecklist::deleteSelf() const -{ - delete this; -} - ACLChecklist::ACLChecklist() : accessList (NULL), my_port (0), request (NULL), reply (NULL), auth_user_request (NULL) diff --git a/src/ACLChecklist.h b/src/ACLChecklist.h index a3edcaba9c..1c826ce039 100644 --- a/src/ACLChecklist.h +++ b/src/ACLChecklist.h @@ -1,6 +1,6 @@ /* - * $Id: ACLChecklist.h,v 1.14 2003/07/14 14:15:55 robertc Exp $ + * $Id: ACLChecklist.h,v 1.15 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -83,7 +83,6 @@ class NullState : public AsyncState void *operator new(size_t); void operator delete(void *); - void deleteSelf() const; ACLChecklist(); ~ACLChecklist(); diff --git a/src/ACLData.h b/src/ACLData.h index 2a72cca32f..96c58b0ecd 100644 --- a/src/ACLData.h +++ b/src/ACLData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLData.h,v 1.4 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLData.h,v 1.5 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class ACLData { public: - virtual void deleteSelf() const =0; virtual ~ACLData() {} diff --git a/src/ACLDestinationDomain.cc b/src/ACLDestinationDomain.cc index 86f094b73b..48be437bd4 100644 --- a/src/ACLDestinationDomain.cc +++ b/src/ACLDestinationDomain.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLDestinationDomain.cc,v 1.5 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLDestinationDomain.cc,v 1.6 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -61,15 +61,9 @@ ACLDestinationDomain::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLDestinationDomain::deleteSelf() const -{ - delete this; -} - ACLDestinationDomain::~ACLDestinationDomain() { - data->deleteSelf(); + delete data; } ACLDestinationDomain::ACLDestinationDomain(ACLData *newData, char const *theType) : data (newData), type_(theType) {} diff --git a/src/ACLDestinationDomain.h b/src/ACLDestinationDomain.h index fad8151498..5676425b59 100644 --- a/src/ACLDestinationDomain.h +++ b/src/ACLDestinationDomain.h @@ -1,6 +1,6 @@ /* - * $Id: ACLDestinationDomain.h,v 1.4 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLDestinationDomain.h,v 1.5 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -57,7 +57,6 @@ class ACLDestinationDomain : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ~ACLDestinationDomain(); ACLDestinationDomain(ACLData *, char const *); diff --git a/src/ACLDestinationIP.cc b/src/ACLDestinationIP.cc index 5456f8fe7e..f497cdf58b 100644 --- a/src/ACLDestinationIP.cc +++ b/src/ACLDestinationIP.cc @@ -57,12 +57,6 @@ ACLDestinationIP::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLDestinationIP::deleteSelf() const -{ - delete this; -} - char const * ACLDestinationIP::typeString() const { diff --git a/src/ACLDestinationIP.h b/src/ACLDestinationIP.h index b103e02f1c..6ee0dc56bf 100644 --- a/src/ACLDestinationIP.h +++ b/src/ACLDestinationIP.h @@ -56,7 +56,6 @@ class ACLDestinationIP : public ACLIP public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual char const *typeString() const; virtual int match(ACLChecklist *checklist); diff --git a/src/ACLDomainData.cc b/src/ACLDomainData.cc index 3e42bfc1f7..186138a452 100644 --- a/src/ACLDomainData.cc +++ b/src/ACLDomainData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLDomainData.cc,v 1.4 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLDomainData.cc,v 1.5 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -58,12 +58,6 @@ ACLDomainData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLDomainData::deleteSelf() const -{ - delete this; -} - template inline void xRefFree(T &thing) diff --git a/src/ACLDomainData.h b/src/ACLDomainData.h index 196ff89706..c90ac8157a 100644 --- a/src/ACLDomainData.h +++ b/src/ACLDomainData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLDomainData.h,v 1.3 2003/02/21 22:50:04 robertc Exp $ + * $Id: ACLDomainData.h,v 1.4 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLDomainData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual ~ACLDomainData(); bool match(char const *); diff --git a/src/ACLExtUser.cc b/src/ACLExtUser.cc index b15b6cdd0c..a38e8ebcaa 100644 --- a/src/ACLExtUser.cc +++ b/src/ACLExtUser.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLExtUser.cc,v 1.3 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLExtUser.cc,v 1.4 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -62,15 +62,9 @@ ACLExtUser::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLExtUser::deleteSelf() const -{ - delete this; -} - ACLExtUser::~ACLExtUser() { - data->deleteSelf(); + delete data; } ACLExtUser::ACLExtUser(ACLData *newData, char const *newType) : data (newData), type_ (newType) {} diff --git a/src/ACLExtUser.h b/src/ACLExtUser.h index ba74c43c0e..34c9de51f2 100644 --- a/src/ACLExtUser.h +++ b/src/ACLExtUser.h @@ -1,6 +1,6 @@ /* - * $Id: ACLExtUser.h,v 1.1 2003/06/27 22:32:31 hno Exp $ + * $Id: ACLExtUser.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLExtUser : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLExtUser(ACLData *newData, char const *); ACLExtUser (ACLExtUser const &old); diff --git a/src/ACLIP.cc b/src/ACLIP.cc index e5b7472e5f..c2c7a025cd 100644 --- a/src/ACLIP.cc +++ b/src/ACLIP.cc @@ -418,12 +418,6 @@ acl_ip_data::operator delete (void *address) memPoolFree (Pool, address); } -void -acl_ip_data::deleteSelf() const -{ - delete this; -} - acl_ip_data::acl_ip_data () :addr1(any_addr), addr2(any_addr), mask (any_addr), next (NULL) {} acl_ip_data::acl_ip_data (struct in_addr const &anAddress1, struct in_addr const &anAddress2, struct in_addr const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext){} diff --git a/src/ACLIP.h b/src/ACLIP.h index 28c4317219..83293c331c 100644 --- a/src/ACLIP.h +++ b/src/ACLIP.h @@ -44,7 +44,6 @@ class acl_ip_data public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; static acl_ip_data *FactoryParse(char const *); static int NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b); @@ -72,7 +71,6 @@ class ACLIP : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const = 0; ACLIP() : data(NULL){} diff --git a/src/ACLIdent.cc b/src/ACLIdent.cc index 787c2ea326..44b72a8f7f 100644 --- a/src/ACLIdent.cc +++ b/src/ACLIdent.cc @@ -61,15 +61,9 @@ ACLIdent::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLIdent::deleteSelf() const -{ - delete this; -} - ACLIdent::~ACLIdent() { - data->deleteSelf(); + delete data; } ACLIdent::ACLIdent(ACLData *newData, char const *newType) : data (newData), type_ (newType) {} diff --git a/src/ACLIdent.h b/src/ACLIdent.h index b54260e977..e0dfe65b1f 100644 --- a/src/ACLIdent.h +++ b/src/ACLIdent.h @@ -57,7 +57,6 @@ class ACLIdent : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLIdent(ACLData *newData, char const *); ACLIdent (ACLIdent const &old); diff --git a/src/ACLIntRange.cc b/src/ACLIntRange.cc index 2ffa41cffe..6d1b49018f 100644 --- a/src/ACLIntRange.cc +++ b/src/ACLIntRange.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLIntRange.cc,v 1.1 2003/02/25 12:16:55 robertc Exp $ + * $Id: ACLIntRange.cc,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Robert Collins @@ -97,12 +97,6 @@ ACLIntRange::match(int i) return false; } -void -ACLIntRange::deleteSelf() const -{ - delete this; -} - ACLData * ACLIntRange::clone() const { @@ -115,7 +109,7 @@ ACLIntRange::clone() const ACLIntRange::~ACLIntRange () { if (ranges) - ranges->deleteSelf(); + delete ranges; } wordlist * diff --git a/src/ACLIntRange.h b/src/ACLIntRange.h index 0488d50836..391aa374d4 100644 --- a/src/ACLIntRange.h +++ b/src/ACLIntRange.h @@ -1,6 +1,6 @@ /* - * $Id: ACLIntRange.h,v 1.1 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLIntRange.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -43,8 +43,6 @@ class ACLIntRange : public ACLData { public: - virtual void deleteSelf() const; - ACLIntRange() : ranges(NULL) {} virtual ~ACLIntRange(); diff --git a/src/ACLMaxConnection.cc b/src/ACLMaxConnection.cc index 496ff39c76..2788c7cf5a 100644 --- a/src/ACLMaxConnection.cc +++ b/src/ACLMaxConnection.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLMaxConnection.cc,v 1.2 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLMaxConnection.cc,v 1.3 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -72,12 +72,6 @@ ACLMaxConnection::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLMaxConnection::deleteSelf() const -{ - delete this; -} - ACLMaxConnection::~ACLMaxConnection() {} diff --git a/src/ACLMaxConnection.h b/src/ACLMaxConnection.h index 95e5ddca02..066ab042e4 100644 --- a/src/ACLMaxConnection.h +++ b/src/ACLMaxConnection.h @@ -1,6 +1,6 @@ /* - * $Id: ACLMaxConnection.h,v 1.1 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLMaxConnection.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -44,7 +44,6 @@ class ACLMaxConnection : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLMaxConnection(char const *); ACLMaxConnection(ACLMaxConnection const &); diff --git a/src/ACLMaxUserIP.cc b/src/ACLMaxUserIP.cc index 0e5203db21..dbcdd327e4 100644 --- a/src/ACLMaxUserIP.cc +++ b/src/ACLMaxUserIP.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLMaxUserIP.cc,v 1.3 2003/07/14 08:21:57 robertc Exp $ + * $Id: ACLMaxUserIP.cc,v 1.4 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -73,12 +73,6 @@ ACLMaxUserIP::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLMaxUserIP::deleteSelf() const -{ - delete this; -} - ACLMaxUserIP::~ACLMaxUserIP() {} diff --git a/src/ACLMaxUserIP.h b/src/ACLMaxUserIP.h index bccf81863e..353f35ebff 100644 --- a/src/ACLMaxUserIP.h +++ b/src/ACLMaxUserIP.h @@ -1,6 +1,6 @@ /* - * $Id: ACLMaxUserIP.h,v 1.2 2003/03/10 11:13:36 robertc Exp $ + * $Id: ACLMaxUserIP.h,v 1.3 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -44,7 +44,6 @@ class ACLMaxUserIP : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLMaxUserIP(char const *); ACLMaxUserIP(ACLMaxUserIP const &); diff --git a/src/ACLMethodData.cc b/src/ACLMethodData.cc index 279373bee9..f935dfd954 100644 --- a/src/ACLMethodData.cc +++ b/src/ACLMethodData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLMethodData.cc,v 1.2 2003/07/14 08:21:57 robertc Exp $ + * $Id: ACLMethodData.cc,v 1.3 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -57,13 +57,6 @@ ACLMethodData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLMethodData::deleteSelf() const -{ - delete this; -} - - ACLMethodData::ACLMethodData() : values (NULL) {} @@ -75,7 +68,7 @@ ACLMethodData::ACLMethodData(ACLMethodData const &old) : values (NULL) ACLMethodData::~ACLMethodData() { if (values) - values->deleteSelf(); + delete values; } bool diff --git a/src/ACLMethodData.h b/src/ACLMethodData.h index ea1fe001d9..97ec7d9fe8 100644 --- a/src/ACLMethodData.h +++ b/src/ACLMethodData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLMethodData.h,v 1.1 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLMethodData.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLMethodData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLMethodData(); ACLMethodData(ACLMethodData const &); diff --git a/src/ACLMyIP.cc b/src/ACLMyIP.cc index d0bec2a23a..1306b0e2c6 100644 --- a/src/ACLMyIP.cc +++ b/src/ACLMyIP.cc @@ -56,12 +56,6 @@ ACLMyIP::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLMyIP::deleteSelf() const -{ - delete this; -} - char const * ACLMyIP::typeString() const { diff --git a/src/ACLMyIP.h b/src/ACLMyIP.h index a24fdc2d9e..dfe289eb05 100644 --- a/src/ACLMyIP.h +++ b/src/ACLMyIP.h @@ -43,7 +43,6 @@ class ACLMyIP : public ACLIP public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; static ACLMyIP const &RegistryEntry(); virtual char const *typeString() const; diff --git a/src/ACLProtocolData.cc b/src/ACLProtocolData.cc index fdde7115b1..424eeabe8f 100644 --- a/src/ACLProtocolData.cc +++ b/src/ACLProtocolData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLProtocolData.cc,v 1.2 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLProtocolData.cc,v 1.3 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -57,13 +57,6 @@ ACLProtocolData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLProtocolData::deleteSelf() const -{ - delete this; -} - - ACLProtocolData::ACLProtocolData() : values (NULL) {} @@ -75,7 +68,7 @@ ACLProtocolData::ACLProtocolData(ACLProtocolData const &old) : values (NULL) ACLProtocolData::~ACLProtocolData() { if (values) - values->deleteSelf(); + delete values; } bool diff --git a/src/ACLProtocolData.h b/src/ACLProtocolData.h index e708104634..23db7afee0 100644 --- a/src/ACLProtocolData.h +++ b/src/ACLProtocolData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLProtocolData.h,v 1.1 2003/02/25 12:22:34 robertc Exp $ + * $Id: ACLProtocolData.h,v 1.2 2003/08/04 22:14:38 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLProtocolData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLProtocolData(); ACLProtocolData(ACLProtocolData const &); diff --git a/src/ACLProxyAuth.cc b/src/ACLProxyAuth.cc index 0b3395149c..bce5c2fec5 100644 --- a/src/ACLProxyAuth.cc +++ b/src/ACLProxyAuth.cc @@ -62,15 +62,9 @@ ACLProxyAuth::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLProxyAuth::deleteSelf() const -{ - delete this; -} - ACLProxyAuth::~ACLProxyAuth() { - data->deleteSelf(); + delete data; } ACLProxyAuth::ACLProxyAuth(ACLData *newData, char const *theType) : data (newData), type_(theType) {} diff --git a/src/ACLProxyAuth.h b/src/ACLProxyAuth.h index 1201819033..53d663d4b6 100644 --- a/src/ACLProxyAuth.h +++ b/src/ACLProxyAuth.h @@ -68,7 +68,6 @@ class ACLProxyAuth : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ~ACLProxyAuth(); ACLProxyAuth(ACLData *, char const *); diff --git a/src/ACLRegexData.cc b/src/ACLRegexData.cc index 64c703c200..b1dedee817 100644 --- a/src/ACLRegexData.cc +++ b/src/ACLRegexData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLRegexData.cc,v 1.5 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLRegexData.cc,v 1.6 2003/08/04 22:14:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -59,12 +59,6 @@ ACLRegexData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLRegexData::deleteSelf() const -{ - delete this; -} - static void aclDestroyRegexList(relist * data); void aclDestroyRegexList(relist * data) diff --git a/src/ACLRegexData.h b/src/ACLRegexData.h index f42007429a..ca84ffdd51 100644 --- a/src/ACLRegexData.h +++ b/src/ACLRegexData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLRegexData.h,v 1.3 2003/02/21 22:50:04 robertc Exp $ + * $Id: ACLRegexData.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -43,7 +43,6 @@ class ACLRegexData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual ~ACLRegexData(); virtual bool match(char const *user); diff --git a/src/ACLSourceIP.cc b/src/ACLSourceIP.cc index 1c9b1867e1..283bd8ba6e 100644 --- a/src/ACLSourceIP.cc +++ b/src/ACLSourceIP.cc @@ -56,12 +56,6 @@ ACLSourceIP::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLSourceIP::deleteSelf() const -{ - delete this; -} - char const * ACLSourceIP::typeString() const { diff --git a/src/ACLSourceIP.h b/src/ACLSourceIP.h index 06b219d6f4..9f3690c049 100644 --- a/src/ACLSourceIP.h +++ b/src/ACLSourceIP.h @@ -43,7 +43,6 @@ class ACLSourceIP : public ACLIP public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual char const *typeString() const; virtual int match(ACLChecklist *checklist); diff --git a/src/ACLStrategised.h b/src/ACLStrategised.h index 34538f12c3..e208fa5fde 100644 --- a/src/ACLStrategised.h +++ b/src/ACLStrategised.h @@ -1,6 +1,6 @@ /* - * $Id: ACLStrategised.h,v 1.4 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLStrategised.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -48,7 +48,6 @@ public: typedef M MatchType; void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ~ACLStrategised(); ACLStrategised(ACLData *, ACLStrategy *, char const *); @@ -99,17 +98,10 @@ ACLStrategised::operator delete (void *address) memPoolFree (Pool, address); } -template -void -ACLStrategised::deleteSelf() const -{ - delete this; -} - template ACLStrategised::~ACLStrategised() { - data->deleteSelf(); + delete data; } template diff --git a/src/ACLStringData.cc b/src/ACLStringData.cc index 33e0112572..44feee6281 100644 --- a/src/ACLStringData.cc +++ b/src/ACLStringData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLStringData.cc,v 1.2 2003/07/14 08:21:56 robertc Exp $ + * $Id: ACLStringData.cc,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -57,13 +57,6 @@ ACLStringData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLStringData::deleteSelf() const -{ - delete this; -} - - ACLStringData::ACLStringData() : values (NULL) {} diff --git a/src/ACLStringData.h b/src/ACLStringData.h index 3817a18bac..9492e5972c 100644 --- a/src/ACLStringData.h +++ b/src/ACLStringData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLStringData.h,v 1.1 2003/02/25 12:22:34 robertc Exp $ + * $Id: ACLStringData.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLStringData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLStringData(); ACLStringData(ACLStringData const &); diff --git a/src/ACLTimeData.cc b/src/ACLTimeData.cc index c87c2d2c77..2cf21f0ecf 100644 --- a/src/ACLTimeData.cc +++ b/src/ACLTimeData.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLTimeData.cc,v 1.3 2003/07/14 08:21:57 robertc Exp $ + * $Id: ACLTimeData.cc,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -58,12 +58,6 @@ ACLTimeData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLTimeData::deleteSelf() const -{ - delete this; -} - ACLTimeData::ACLTimeData () : weekbits (0), start (0), stop (0), next (NULL) {} ACLTimeData::ACLTimeData(ACLTimeData const &old) : weekbits(old.weekbits), start (old.start), stop (old.stop), next (NULL) @@ -89,7 +83,7 @@ ACLTimeData::operator=(ACLTimeData const &old) ACLTimeData::~ACLTimeData() { if (next) - next->deleteSelf(); + delete next; } bool @@ -224,7 +218,7 @@ ACLTimeData::parse() debug(28, 0) ("aclParseTimeSpec: IGNORING Bad time range\n"); if (q != this) - q->deleteSelf(); + delete q; return; } @@ -238,7 +232,7 @@ ACLTimeData::parse() debug(28, 0) ("aclParseTimeSpec: IGNORING Reversed time range\n"); if (q != this) - q->deleteSelf(); + delete q; return; } diff --git a/src/ACLTimeData.h b/src/ACLTimeData.h index 144a90b4f0..2cb883af6b 100644 --- a/src/ACLTimeData.h +++ b/src/ACLTimeData.h @@ -1,6 +1,6 @@ /* - * $Id: ACLTimeData.h,v 1.2 2003/02/21 22:50:04 robertc Exp $ + * $Id: ACLTimeData.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ class ACLTimeData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; ACLTimeData(); ACLTimeData(ACLTimeData const &); diff --git a/src/ACLUserData.cc b/src/ACLUserData.cc index 2617d0f0d7..c380c4966a 100644 --- a/src/ACLUserData.cc +++ b/src/ACLUserData.cc @@ -58,12 +58,6 @@ ACLUserData::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLUserData::deleteSelf() const -{ - delete this; -} - template inline void xRefFree(T &thing) diff --git a/src/ACLUserData.h b/src/ACLUserData.h index 790caadbca..34cb833ba1 100644 --- a/src/ACLUserData.h +++ b/src/ACLUserData.h @@ -45,7 +45,6 @@ class ACLUserData : public ACLData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; virtual ~ACLUserData(); bool match(char const *user); diff --git a/src/CommonPool.h b/src/CommonPool.h index 6f2acbd96b..8401379a96 100644 --- a/src/CommonPool.h +++ b/src/CommonPool.h @@ -1,6 +1,6 @@ /* - * $Id: CommonPool.h,v 1.2 2003/02/21 22:50:05 robertc Exp $ + * $Id: CommonPool.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -57,7 +57,6 @@ class CommonPool public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; static CommonPool *Factory (unsigned char _class, CompositePoolNode::Pointer&); char const* theClassTypeLabel() const {return typeLabel.buf();} diff --git a/src/CompositePoolNode.h b/src/CompositePoolNode.h index d034c73000..95b480c677 100644 --- a/src/CompositePoolNode.h +++ b/src/CompositePoolNode.h @@ -1,6 +1,6 @@ /* - * $Id: CompositePoolNode.h,v 1.4 2003/05/20 12:17:38 robertc Exp $ + * $Id: CompositePoolNode.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -59,7 +59,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; virtual ~CompositePoolNode(){} virtual void stats(StoreEntry * sentry) =0; diff --git a/src/DelayIdComposite.h b/src/DelayIdComposite.h index de9c4bf07f..079757494f 100644 --- a/src/DelayIdComposite.h +++ b/src/DelayIdComposite.h @@ -1,6 +1,6 @@ /* - * $Id: DelayIdComposite.h,v 1.3 2003/03/04 01:40:25 robertc Exp $ + * $Id: DelayIdComposite.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -52,7 +52,6 @@ class DelayIdComposite : public RefCountable public: typedef RefCount Pointer; - virtual void deleteSelf() const = 0; virtual inline ~DelayIdComposite(){} virtual int bytesWanted (int min, int max) const =0; diff --git a/src/DelayPool.cc b/src/DelayPool.cc index 116df2a25c..5e9b783c68 100644 --- a/src/DelayPool.cc +++ b/src/DelayPool.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayPool.cc,v 1.4 2003/03/04 01:40:25 robertc Exp $ + * $Id: DelayPool.cc,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -99,7 +99,7 @@ DelayPool::createPool(u_char delay_class) void DelayPool::freeData() { - pool->deleteSelf(); + delete pool; pool = NULL; } diff --git a/src/DelayTagged.cc b/src/DelayTagged.cc index 1e735cd78a..8b3bc8243f 100644 --- a/src/DelayTagged.cc +++ b/src/DelayTagged.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayTagged.cc,v 1.3 2003/05/22 11:14:43 robertc Exp $ + * $Id: DelayTagged.cc,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -58,12 +58,6 @@ DelayTagged::operator delete (void *address) ::operator delete (address); } -void -DelayTagged::deleteSelf() const -{ - delete this; -} - DelayTagged::DelayTagged() { DelayPools::registerForUpdates (this); @@ -175,12 +169,6 @@ DelayTagged::Id::operator delete (void *address) ::operator delete (address); } -void -DelayTagged::Id::deleteSelf() const -{ - delete this; -} - void * DelayTaggedBucket::operator new(size_t size) { diff --git a/src/DelayTagged.h b/src/DelayTagged.h index 85fb119cd5..2ad149f12a 100644 --- a/src/DelayTagged.h +++ b/src/DelayTagged.h @@ -1,6 +1,6 @@ /* - * $Id: DelayTagged.h,v 1.3 2003/08/03 09:03:48 robertc Exp $ + * $Id: DelayTagged.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -56,7 +56,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const {delete this;} void stats(StoreEntry *)const; DelayTaggedBucket(String &aTag); @@ -72,7 +71,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; DelayTagged(); virtual ~DelayTagged(); virtual void stats(StoreEntry * sentry); @@ -90,7 +88,6 @@ class Id:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Id (RefCount, String &); ~Id(); virtual int bytesWanted (int min, int max) const; diff --git a/src/DelayUser.cc b/src/DelayUser.cc index 82fd35de76..c88ebbfbc1 100644 --- a/src/DelayUser.cc +++ b/src/DelayUser.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayUser.cc,v 1.5 2003/05/20 12:17:38 robertc Exp $ + * $Id: DelayUser.cc,v 1.6 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -58,12 +58,6 @@ DelayUser::operator delete (void *address) ::operator delete (address); } -void -DelayUser::deleteSelf() const -{ - delete this; -} - DelayUser::DelayUser() { DelayPools::registerForUpdates (this); @@ -173,12 +167,6 @@ DelayUser::Id::operator delete (void *address) ::operator delete (address); } -void -DelayUser::Id::deleteSelf() const -{ - delete this; -} - void * DelayUserBucket::operator new(size_t size) { diff --git a/src/DelayUser.h b/src/DelayUser.h index f3ac3ce46e..ac575b14d5 100644 --- a/src/DelayUser.h +++ b/src/DelayUser.h @@ -1,6 +1,6 @@ /* - * $Id: DelayUser.h,v 1.6 2003/08/03 09:03:48 robertc Exp $ + * $Id: DelayUser.h,v 1.7 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -56,7 +56,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const {delete this;} void stats(StoreEntry *)const; DelayUserBucket(AuthUser *); @@ -72,7 +71,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; DelayUser(); virtual ~DelayUser(); virtual void stats(StoreEntry * sentry); @@ -90,7 +88,6 @@ class Id:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Id (RefCount, AuthUser *); ~Id(); virtual int bytesWanted (int min, int max) const; diff --git a/src/DelayVector.cc b/src/DelayVector.cc index b04cd417c8..311d256fd7 100644 --- a/src/DelayVector.cc +++ b/src/DelayVector.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayVector.cc,v 1.8 2003/05/20 12:17:38 robertc Exp $ + * $Id: DelayVector.cc,v 1.9 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -58,12 +58,6 @@ DelayVector::operator delete (void *address) ::operator delete (address); } -void -DelayVector::deleteSelf() const -{ - delete this; -} - DelayVector::DelayVector() { DelayPools::registerForUpdates (this); @@ -144,12 +138,6 @@ DelayVector::Id::operator delete (void *address) ::operator delete (address); } -void -DelayVector::Id::deleteSelf() const -{ - delete this; -} - DelayVector::Id::Id(DelayVector::Pointer aDelayVector, CompositeSelectionDetails &details) : theVector(aDelayVector) { debug(77,3)("DelayVector::Id::Id\n"); diff --git a/src/DelayVector.h b/src/DelayVector.h index 42a2eb328c..e6c8394e8c 100644 --- a/src/DelayVector.h +++ b/src/DelayVector.h @@ -1,6 +1,6 @@ /* - * $Id: DelayVector.h,v 1.8 2003/08/03 09:03:48 robertc Exp $ + * $Id: DelayVector.h,v 1.9 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; DelayVector(); virtual ~DelayVector(); virtual void stats(StoreEntry * sentry); @@ -64,7 +63,6 @@ class Id:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Id (RefCount,CompositeSelectionDetails &); ~Id(); diff --git a/src/ESI.cc b/src/ESI.cc index 8a6006c4c0..bf0f52bd9a 100644 --- a/src/ESI.cc +++ b/src/ESI.cc @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.4 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESI.cc,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -99,7 +99,6 @@ struct esiComment : public ESIElement { void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf()const; ~esiComment(); esiComment(); Pointer makeCacheable() const; @@ -130,7 +129,6 @@ class esiRemove : public ESIElement public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiRemove(); void render(ESISegment::Pointer); @@ -151,7 +149,6 @@ struct esiTry : public ESIElement { void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiTry(esiTreeParentPtr aParent); ~esiTry(); @@ -205,7 +202,6 @@ struct esiChoose : public ESIElement { void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiChoose(esiTreeParentPtr); ~esiChoose(); @@ -243,7 +239,6 @@ struct esiWhen : public esiSequence { void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiWhen(esiTreeParentPtr aParent, int attributes, const char **attr, ESIVarState *); ~esiWhen(); Pointer makeCacheable() const; @@ -270,7 +265,6 @@ struct esiOtherwise : public esiSequence { // void *operator new (size_t byteCount); // void operator delete (void *address); - void deleteSelf() const; esiOtherwise(esiTreeParentPtr aParent) : esiSequence (aParent) {}} ; @@ -325,12 +319,6 @@ ESIContext::operator delete (void *address) cbdataReferenceDone (address); } -void -ESIContext::deleteSelf() const -{ - delete this; -} - void ESIContext::setError() { @@ -1463,7 +1451,7 @@ ESIContext::freeResources () ESISegmentFreeList (buffered); ESISegmentFreeList (outbound); ESISegmentFreeList (outboundtail); - varState->deleteSelf(); + delete varState; /* don't touch incoming, it's a pointer into buffered anyway */ } @@ -1537,12 +1525,6 @@ esiComment::operator delete (void *address) memPoolFree (pool, address); } -void -esiComment::deleteSelf() const -{ - delete this; -} - esiComment::esiComment() {} @@ -1589,12 +1571,6 @@ esiLiteral::operator delete (void *address) memPoolFree (pool, address); } -void -esiLiteral::deleteSelf() const -{ - delete this; -} - esiLiteral::~esiLiteral() { debug (86, 5) ("esiLiteral::~esiLiteral: %p\n", this); @@ -1719,12 +1695,6 @@ esiRemove::operator delete (void *address) cbdataFree (address); } -void -esiRemove::deleteSelf() const -{ - delete this; -} - ESIElement * esiRemoveNew () { @@ -1794,12 +1764,6 @@ esiTry::operator delete (void *address) memPoolFree (Pool, address); } -void -esiTry::deleteSelf() const -{ - delete this; -} - esiTry::esiTry(esiTreeParentPtr aParent) : parent (aParent) , exceptbuffer(NULL) {} @@ -2070,11 +2034,6 @@ esiAttempt::operator delete (void *address) } #endif -void -esiAttempt::deleteSelf() const -{ - delete this; -} /* esiExcept */ #if 0 @@ -2095,11 +2054,6 @@ esiExcept::operator delete (void *address) } #endif -void -esiExcept::deleteSelf() const -{ - delete this; -} /* ESIVar */ #if 0 @@ -2121,12 +2075,6 @@ esiVar::operator delete (void *address) #endif -void -ESIVar::deleteSelf() const -{ - delete this; -} - /* esiChoose */ esiChoose::~esiChoose() { @@ -2150,12 +2098,6 @@ esiChoose::operator delete (void *address) memPoolFree (Pool, address); } -void -esiChoose::deleteSelf() const -{ - delete this; -} - esiChoose::esiChoose(esiTreeParentPtr aParent) : elements (), chosenelement (-1),parent (aParent) {} @@ -2474,12 +2416,6 @@ esiWhen::operator delete (void *address) memPoolFree(Pool, address); } -void -esiWhen::deleteSelf() const -{ - delete this; -} - esiWhen::esiWhen (esiTreeParentPtr aParent, int attrcount, const char **attr,ESIVarState *aVar) : esiSequence (aParent) { varState = NULL; @@ -2584,12 +2520,6 @@ esiOtherwise::operator delete (void *address) #endif -void -esiOtherwise::deleteSelf() const -{ - delete this; -} - /* TODO: implement surrogate targeting and control processing */ int esiEnableProcessing (HttpReply *rep) diff --git a/src/ESIAssign.cc b/src/ESIAssign.cc index 46a13e86d1..3a5fdc8152 100644 --- a/src/ESIAssign.cc +++ b/src/ESIAssign.cc @@ -1,6 +1,6 @@ /* - * $Id: ESIAssign.cc,v 1.1 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESIAssign.cc,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -57,12 +57,6 @@ ESIAssign::operator delete (void *address) memPoolFree (Pool, address); } -void -ESIAssign::deleteSelf() const -{ - delete this; -} - ESIAssign::~ESIAssign() { if (value) diff --git a/src/ESIAssign.h b/src/ESIAssign.h index 31b3a5454b..fe9b7d45e1 100644 --- a/src/ESIAssign.h +++ b/src/ESIAssign.h @@ -1,5 +1,5 @@ /* - * $Id: ESIAssign.h,v 1.1 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESIAssign.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -66,7 +66,6 @@ class ESIAssign : public ESIElement public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; ESIAssign (esiTreeParentPtr, int, const char **, ESIContext *); ESIAssign (ESIAssign const &); ESIAssign &operator=(ESIAssign const &); diff --git a/src/ESIAttempt.h b/src/ESIAttempt.h index f919bcec1f..2f6aaf26aa 100644 --- a/src/ESIAttempt.h +++ b/src/ESIAttempt.h @@ -1,5 +1,5 @@ /* - * $Id: ESIAttempt.h,v 1.1 2003/03/10 04:56:35 robertc Exp $ + * $Id: ESIAttempt.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -46,7 +46,6 @@ struct esiAttempt : public esiSequence { // void *operator new (size_t byteCount); // void operator delete (void *address); - void deleteSelf() const; esiAttempt(esiTreeParentPtr aParent) : esiSequence (aParent) {}} ; diff --git a/src/ESIContext.h b/src/ESIContext.h index 1d687deb26..240ab3af81 100644 --- a/src/ESIContext.h +++ b/src/ESIContext.h @@ -1,5 +1,5 @@ /* - * $Id: ESIContext.h,v 1.3 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESIContext.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -52,7 +52,6 @@ public: typedef RefCount Pointer; void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; ESIContext():reading_(true) {} ~ESIContext(); diff --git a/src/ESICustomParser.cc b/src/ESICustomParser.cc index 8f0f2bda03..0183f260c3 100644 --- a/src/ESICustomParser.cc +++ b/src/ESICustomParser.cc @@ -1,6 +1,6 @@ /* - * $Id: ESICustomParser.cc,v 1.3 2003/07/15 23:12:02 robertc Exp $ + * $Id: ESICustomParser.cc,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -61,12 +61,6 @@ ESICustomParser::GetTrie() return SearchTrie; } -void -ESICustomParser::deleteSelf() const -{ - delete this; -} - ESICustomParser::ESICustomParser(ESIParserClient *aClient) : theClient (aClient) {} diff --git a/src/ESICustomParser.h b/src/ESICustomParser.h index 32899c7475..30af6c298d 100644 --- a/src/ESICustomParser.h +++ b/src/ESICustomParser.h @@ -1,5 +1,5 @@ /* - * $Id: ESICustomParser.h,v 1.3 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESICustomParser.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -41,7 +41,6 @@ class ESICustomParser : public ESIParser { public: - virtual void deleteSelf() const; ESICustomParser(ESIParserClient *); ~ESICustomParser(); /* true on success */ diff --git a/src/ESIElement.h b/src/ESIElement.h index 1cbc1c376a..47cd226270 100644 --- a/src/ESIElement.h +++ b/src/ESIElement.h @@ -1,5 +1,5 @@ /* - * $Id: ESIElement.h,v 1.3 2003/07/14 20:29:28 robertc Exp $ + * $Id: ESIElement.h,v 1.4 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -100,8 +100,6 @@ public: return ESI_PROCESS_COMPLETE; } - virtual void deleteSelf() const = 0; - virtual bool mayFail() const { return true; diff --git a/src/ESIExcept.h b/src/ESIExcept.h index b96d3e11c5..f923425028 100644 --- a/src/ESIExcept.h +++ b/src/ESIExcept.h @@ -1,5 +1,5 @@ /* - * $Id: ESIExcept.h,v 1.2 2003/07/15 23:12:02 robertc Exp $ + * $Id: ESIExcept.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -48,7 +48,6 @@ class esiExcept : public esiSequence public: // void *operator new (size_t byteCount); // void operator delete (void *address); - void deleteSelf() const; esiExcept(esiTreeParentPtr aParent) : esiSequence (aParent) {}} ; diff --git a/src/ESIExpatParser.cc b/src/ESIExpatParser.cc index 7f4bec6e28..b9cb7953d8 100644 --- a/src/ESIExpatParser.cc +++ b/src/ESIExpatParser.cc @@ -1,6 +1,6 @@ /* - * $Id: ESIExpatParser.cc,v 1.1 2003/03/10 04:56:35 robertc Exp $ + * $Id: ESIExpatParser.cc,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -36,12 +36,6 @@ #include "squid.h" #include "ESIExpatParser.h" -void -ESIExpatParser::deleteSelf() const -{ - delete this; -} - ESIExpatParser::ESIExpatParser(ESIParserClient *aClient) : theClient (aClient) { /* TODO: grab the document encoding from the headers */ diff --git a/src/ESIExpatParser.h b/src/ESIExpatParser.h index 08545acaf3..67c091bc56 100644 --- a/src/ESIExpatParser.h +++ b/src/ESIExpatParser.h @@ -1,5 +1,5 @@ /* - * $Id: ESIExpatParser.h,v 1.1 2003/03/10 04:56:35 robertc Exp $ + * $Id: ESIExpatParser.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -40,7 +40,6 @@ class ESIExpatParser : public ESIParser { public: - virtual void deleteSelf() const; ESIExpatParser(ESIParserClient *); ~ESIExpatParser(); /* true on success */ diff --git a/src/ESIInclude.cc b/src/ESIInclude.cc index e92af5a6d7..6ee9b89bb7 100644 --- a/src/ESIInclude.cc +++ b/src/ESIInclude.cc @@ -1,6 +1,6 @@ /* - * $Id: ESIInclude.cc,v 1.2 2003/07/23 10:41:20 robertc Exp $ + * $Id: ESIInclude.cc,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -251,12 +251,6 @@ ESIStreamContext::operator delete (void *address) cbdataReferenceDone (address); } -void -ESIStreamContext::deleteSelf() const -{ - delete this; -} - ESIStreamContext * ESIStreamContextNew (ESIIncludePtr include) { @@ -301,12 +295,6 @@ ESIInclude::operator delete (void *address) memPoolFree (Pool, address); } -void -ESIInclude::deleteSelf() const -{ - delete this; -} - ESIElement::Pointer ESIInclude::makeCacheable() const { diff --git a/src/ESIInclude.h b/src/ESIInclude.h index 3c1f1453be..621a337d96 100644 --- a/src/ESIInclude.h +++ b/src/ESIInclude.h @@ -1,5 +1,5 @@ /* - * $Id: ESIInclude.h,v 1.1 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESIInclude.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -51,7 +51,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete(void *); - void deleteSelf() const; ESIStreamContext(); ~ESIStreamContext(); void freeResources(); @@ -72,7 +71,6 @@ class ESIInclude : public ESIElement public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; ESIInclude(esiTreeParentPtr, int attributes, const char **attr, ESIContext *); ~ESIInclude(); diff --git a/src/ESILiteral.h b/src/ESILiteral.h index 7c4c0ac79d..9a4ba939b6 100644 --- a/src/ESILiteral.h +++ b/src/ESILiteral.h @@ -1,5 +1,5 @@ /* - * $Id: ESILiteral.h,v 1.2 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESILiteral.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -46,7 +46,6 @@ struct esiLiteral : public ESIElement { void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiLiteral(ESISegment::Pointer); esiLiteral(ESIContext *, const char *s, int len); diff --git a/src/ESIParser.h b/src/ESIParser.h index ec182c7385..e965f0e869 100644 --- a/src/ESIParser.h +++ b/src/ESIParser.h @@ -1,5 +1,5 @@ /* - * $Id: ESIParser.h,v 1.1 2003/03/10 04:56:36 robertc Exp $ + * $Id: ESIParser.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -50,7 +50,6 @@ public: typedef RefCount Pointer; static Pointer NewParser(ESIParserClient *aClient); static char *Type; - virtual void deleteSelf() const =0; /* true on success */ virtual bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream) = 0; virtual size_t lineNumber() const =0; diff --git a/src/ESISegment.cc b/src/ESISegment.cc index 8d75c3e289..c9eb54f1b0 100644 --- a/src/ESISegment.cc +++ b/src/ESISegment.cc @@ -1,6 +1,6 @@ /* - * $Id: ESISegment.cc,v 1.2 2003/03/11 08:24:42 robertc Exp $ + * $Id: ESISegment.cc,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -166,12 +166,6 @@ ESISegment::operator delete (void *address) cbdataFree (address); } -void -ESISegment::deleteSelf() const -{ - delete this; -} - /* XXX: if needed, make this iterative */ ESISegment::Pointer ESISegment::cloneList () const diff --git a/src/ESISegment.h b/src/ESISegment.h index ff4a18bc38..44da5717e2 100644 --- a/src/ESISegment.h +++ b/src/ESISegment.h @@ -1,5 +1,5 @@ /* - * $Id: ESISegment.h,v 1.2 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESISegment.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -49,7 +49,6 @@ public: static void ListTransfer (Pointer &from, Pointer &to); void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; ESISegment(); ESISegment(ESISegment const &); diff --git a/src/ESISequence.cc b/src/ESISequence.cc index 6344133807..bfda742099 100644 --- a/src/ESISequence.cc +++ b/src/ESISequence.cc @@ -1,5 +1,5 @@ /* - * $Id: ESISequence.cc,v 1.2 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESISequence.cc,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -43,12 +43,6 @@ class esiExcept; MemPool *esiSequence::Pool = NULL; -void -esiSequence::deleteSelf() const -{ - delete this; -} - esiSequence::~esiSequence () { debug (86,5)("esiSequence::~esiSequence %p\n", this); diff --git a/src/ESISequence.h b/src/ESISequence.h index 81bf9bd45e..58a27785c0 100644 --- a/src/ESISequence.h +++ b/src/ESISequence.h @@ -1,5 +1,5 @@ /* - * $Id: ESISequence.h,v 1.2 2003/07/14 14:15:56 robertc Exp $ + * $Id: ESISequence.h,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -48,7 +48,6 @@ class esiSequence : public ESIElement public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; esiSequence(esiTreeParentPtr, bool = false); ~esiSequence(); diff --git a/src/ESIVar.h b/src/ESIVar.h index d28a705784..95434b85dd 100644 --- a/src/ESIVar.h +++ b/src/ESIVar.h @@ -1,5 +1,5 @@ /* - * $Id: ESIVar.h,v 1.1 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESIVar.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -48,7 +48,6 @@ class ESIVar:public esiSequence public: // void *operator new (size_t byteCount); // void operator delete (void *address); - void deleteSelf() const; ESIVar(esiTreeParentPtr aParent) : esiSequence (aParent) { flags.dovars = 1; diff --git a/src/ESIVarState.cc b/src/ESIVarState.cc index 8bebc10416..ca6cf6205c 100644 --- a/src/ESIVarState.cc +++ b/src/ESIVarState.cc @@ -1,6 +1,6 @@ /* - * $Id: ESIVarState.cc,v 1.2 2003/07/23 10:41:20 robertc Exp $ + * $Id: ESIVarState.cc,v 1.3 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -202,12 +202,6 @@ ESIVarState::operator delete (void *address) cbdataFree (address); } -void -ESIVarState::deleteSelf() const -{ - delete this; -} - char * ESIVariableUserAgent::getProductVersion (char const *s) { diff --git a/src/ESIVarState.h b/src/ESIVarState.h index 36929ee48a..b1106de8f0 100644 --- a/src/ESIVarState.h +++ b/src/ESIVarState.h @@ -1,6 +1,6 @@ /* - * $Id: ESIVarState.h,v 1.1 2003/07/14 14:15:55 robertc Exp $ + * $Id: ESIVarState.h,v 1.2 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -68,7 +68,6 @@ public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; void freeResources(); ESIVarState (HttpHeader const *hdr, char const *uri); ~ESIVarState(); diff --git a/src/ExternalACL.h b/src/ExternalACL.h index bb35bed64b..174ec5b0b4 100644 --- a/src/ExternalACL.h +++ b/src/ExternalACL.h @@ -1,6 +1,6 @@ /* - * $Id: ExternalACL.h,v 1.4 2003/05/20 12:17:38 robertc Exp $ + * $Id: ExternalACL.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -60,7 +60,6 @@ class ACLExternal : public ACL public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; static void ExternalAclLookup(ACLChecklist * ch, ACLExternal *, EAH * callback, void *callback_data); diff --git a/src/ExternalACLEntry.cc b/src/ExternalACLEntry.cc index 51812dc685..88ffbe6b6b 100644 --- a/src/ExternalACLEntry.cc +++ b/src/ExternalACLEntry.cc @@ -1,6 +1,6 @@ /* - * $Id: ExternalACLEntry.cc,v 1.4 2003/07/09 14:14:57 hno Exp $ + * $Id: ExternalACLEntry.cc,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -65,12 +65,6 @@ ExternalACLEntry::operator delete (void *address) cbdataFree (address); } -void -ExternalACLEntry::deleteSelf() const -{ - delete this; -} - ExternalACLEntry::ExternalACLEntry() { lru.next = lru.prev = NULL; diff --git a/src/ExternalACLEntry.h b/src/ExternalACLEntry.h index 8d10eab294..3e2ce8099f 100644 --- a/src/ExternalACLEntry.h +++ b/src/ExternalACLEntry.h @@ -1,6 +1,6 @@ /* - * $Id: ExternalACLEntry.h,v 1.4 2003/07/09 14:14:57 hno Exp $ + * $Id: ExternalACLEntry.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -77,7 +77,6 @@ class ExternalACLEntry: public hash_link public: void *operator new (size_t bytesToAllocate); void operator delete (void *address); - void deleteSelf() const; ExternalACLEntry(); ~ExternalACLEntry(); diff --git a/src/HttpHdrRange.cc b/src/HttpHdrRange.cc index aedc9e09c5..1d0fe8fbd7 100644 --- a/src/HttpHdrRange.cc +++ b/src/HttpHdrRange.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.cc,v 1.36 2003/07/14 14:15:56 robertc Exp $ + * $Id: HttpHdrRange.cc,v 1.37 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -88,12 +88,6 @@ HttpHdrRangeSpec::operator delete (void *spec) memPoolFree(Pool, spec); } -void -HttpHdrRangeSpec::deleteSelf() const -{ - delete this; -} - HttpHdrRangeSpec::HttpHdrRangeSpec() : offset(UnknownPosition), length(UnknownPosition){} /* parses range-spec and returns new object on success */ @@ -270,12 +264,6 @@ HttpHdrRange::operator delete (void *address) memPoolFree(Pool, address); } -void -HttpHdrRange::deleteSelf() const -{ - delete this; -} - HttpHdrRange::HttpHdrRange () : clen (HttpHdrRangeSpec::UnknownPosition) {} @@ -285,7 +273,7 @@ HttpHdrRange::ParseCreate(const String * range_spec) HttpHdrRange *r = new HttpHdrRange; if (!r->parseInit(range_spec)) { - r->deleteSelf(); + delete r; r = NULL; } @@ -332,7 +320,7 @@ HttpHdrRange::parseInit(const String * range_spec) HttpHdrRange::~HttpHdrRange() { while (specs.size()) - specs.pop_back()->deleteSelf(); + delete specs.pop_back(); } HttpHdrRange::HttpHdrRange(HttpHdrRange const &old) : specs() @@ -398,7 +386,7 @@ HttpHdrRange::merge (Vector &basis) while (i != basis.end()) { if (specs.size() && (*i)->mergeWith(specs.back())) { /* merged with current so get rid of the prev one */ - specs.pop_back()->deleteSelf(); + delete specs.pop_back(); continue; /* re-iterate */ } @@ -420,7 +408,7 @@ HttpHdrRange::getCanonizedSpecs (Vector ©) if ((*pos)->canonize(clen)) copy.push_back (*pos); else - (*pos)->deleteSelf(); + delete (*pos); } debug(64, 3) ("HttpHdrRange::getCanonizedSpecs: found %d bad specs\n", diff --git a/src/HttpHeaderRange.h b/src/HttpHeaderRange.h index ad63601cb3..8a184fa1d3 100644 --- a/src/HttpHeaderRange.h +++ b/src/HttpHeaderRange.h @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderRange.h,v 1.4 2003/07/14 23:53:40 robertc Exp $ + * $Id: HttpHeaderRange.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -46,7 +46,6 @@ class HttpHdrRangeSpec public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; typedef Range HttpRange; static ssize_t const UnknownPosition; @@ -76,7 +75,6 @@ class HttpHdrRange public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; static size_t ParsedCount; /* Http Range Header Field */ diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 248b56f03b..591536b40f 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.41 2003/07/15 11:33:21 robertc Exp $ + * $Id: HttpRequest.cc,v 1.42 2003/08/04 22:14:40 robertc Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -60,12 +60,6 @@ HttpRequest::operator delete (void *address) memPoolFree (Pool, address); } -void -HttpRequest::deleteSelf() const -{ - delete this; -} - HttpRequest::HttpRequest() : header(hoRequest) { /* We should initialise these ... */ @@ -151,7 +145,7 @@ requestDestroy(request_t * req) httpHdrCcDestroy(req->cache_control); if (req->range) - req->range->deleteSelf(); + delete req->range; req->tag.clean(); @@ -161,7 +155,7 @@ requestDestroy(request_t * req) req->extacl_log.clean(); - req->deleteSelf(); + delete req; } request_t * diff --git a/src/HttpRequest.h b/src/HttpRequest.h index c3ff7e1183..20d79bc250 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.5 2003/07/15 11:33:21 robertc Exp $ + * $Id: HttpRequest.h,v 1.6 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -58,7 +58,6 @@ class HttpRequest public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; HttpRequest(); virtual ~HttpRequest() {} diff --git a/src/NullDelayId.cc b/src/NullDelayId.cc index 9b37f89685..e333bf3e54 100644 --- a/src/NullDelayId.cc +++ b/src/NullDelayId.cc @@ -1,6 +1,6 @@ /* - * $Id: NullDelayId.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: NullDelayId.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -58,11 +58,5 @@ NullDelayId::operator delete (void *address) ::operator delete (address); } -void -NullDelayId::deleteSelf() const -{ - delete this; -} - #endif diff --git a/src/NullDelayId.h b/src/NullDelayId.h index f8782c0291..7287826788 100644 --- a/src/NullDelayId.h +++ b/src/NullDelayId.h @@ -1,6 +1,6 @@ /* - * $Id: NullDelayId.h,v 1.3 2003/03/10 11:13:36 robertc Exp $ + * $Id: NullDelayId.h,v 1.4 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -52,7 +52,6 @@ class NullDelayId : public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; virtual int bytesWanted (int minimum, int maximum) const {return max(minimum,maximum);} virtual void bytesIn(int qty) {}} diff --git a/src/StoreIOState.h b/src/StoreIOState.h index 7e08d09ba9..410e1a0c7c 100644 --- a/src/StoreIOState.h +++ b/src/StoreIOState.h @@ -1,6 +1,6 @@ /* - * $Id: StoreIOState.h,v 1.5 2003/07/22 15:23:01 robertc Exp $ + * $Id: StoreIOState.h,v 1.6 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -44,7 +44,6 @@ public: /* storeIOState does not get mempooled - it's children do */ void *operator new (size_t amount); void operator delete (void *address); - virtual void deleteSelf() const = 0; virtual ~storeIOState(); storeIOState(); diff --git a/src/StoreMeta.cc b/src/StoreMeta.cc index 152d9aafc7..5cdb0cd9a1 100644 --- a/src/StoreMeta.cc +++ b/src/StoreMeta.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMeta.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMeta.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -137,7 +137,7 @@ StoreMeta::Factory (char type, size_t len, void const *value) } if (!result->validLength(len)) { - result->deleteSelf(); + delete result; return NULL; } @@ -155,7 +155,7 @@ StoreMeta::FreeList(StoreMeta **head) while ((node = *head) != NULL) { *head = node->next; xfree(node->value); - node->deleteSelf(); + delete node; } } @@ -190,9 +190,3 @@ StoreMeta::checkConsistency(StoreEntry *e) const return true; } - -void -StoreMeta::deleteSelf() -{ - delete this; -} diff --git a/src/StoreMeta.h b/src/StoreMeta.h index 6bb256314f..f8a86af6e7 100644 --- a/src/StoreMeta.h +++ b/src/StoreMeta.h @@ -1,6 +1,6 @@ /* - * $Id: StoreMeta.h,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMeta.h,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class StoreMeta { public: - virtual void deleteSelf() = 0; static bool validType(char); static int const MaximumTLVLength; static int const MinimumTLVLength; diff --git a/src/StoreMetaMD5.cc b/src/StoreMetaMD5.cc index 9108b3ec75..f16ceff45e 100644 --- a/src/StoreMetaMD5.cc +++ b/src/StoreMetaMD5.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaMD5.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaMD5.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -58,12 +58,6 @@ StoreMetaMD5::operator delete (void *address) memPoolFree(pool, address); } -void -StoreMetaMD5::deleteSelf() -{ - delete this; -} - bool StoreMetaMD5::validLength(int len) const { diff --git a/src/StoreMetaMD5.h b/src/StoreMetaMD5.h index ee789f025e..56a1f5e695 100644 --- a/src/StoreMetaMD5.h +++ b/src/StoreMetaMD5.h @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaMD5.h,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaMD5.h,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class StoreMetaMD5 : public StoreMeta public: void *operator new (size_t); void operator delete (void *); - void deleteSelf(); char getType() const {return STORE_META_KEY_MD5;} diff --git a/src/StoreMetaSTD.cc b/src/StoreMetaSTD.cc index ec4dc9bb2c..83363db6ad 100644 --- a/src/StoreMetaSTD.cc +++ b/src/StoreMetaSTD.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaSTD.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaSTD.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -58,12 +58,6 @@ StoreMetaSTD::operator delete (void *address) memPoolFree(pool, address); } -void -StoreMetaSTD::deleteSelf() -{ - delete this; -} - bool StoreMetaSTD::validLength(int len) const { diff --git a/src/StoreMetaSTD.h b/src/StoreMetaSTD.h index 24357d7a2f..a67c5ea6e6 100644 --- a/src/StoreMetaSTD.h +++ b/src/StoreMetaSTD.h @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaSTD.h,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaSTD.h,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class StoreMetaSTD : public StoreMeta public: void *operator new (size_t); void operator delete (void *); - void deleteSelf(); char getType() const {return STORE_META_STD;} diff --git a/src/StoreMetaURL.cc b/src/StoreMetaURL.cc index 150f983156..4cc7ee7eb1 100644 --- a/src/StoreMetaURL.cc +++ b/src/StoreMetaURL.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaURL.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaURL.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -58,12 +58,6 @@ StoreMetaURL::operator delete (void *address) memPoolFree(pool, address); } -void -StoreMetaURL::deleteSelf() -{ - delete this; -} - bool StoreMetaURL::checkConsistency(StoreEntry *e) const { diff --git a/src/StoreMetaURL.h b/src/StoreMetaURL.h index 6c2efbbfb6..bb476e6b60 100644 --- a/src/StoreMetaURL.h +++ b/src/StoreMetaURL.h @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaURL.h,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaURL.h,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class StoreMetaURL : public StoreMeta public: void *operator new (size_t); void operator delete (void *); - void deleteSelf(); char getType() const {return STORE_META_URL;} diff --git a/src/StoreMetaVary.cc b/src/StoreMetaVary.cc index 8743a4ed7d..2a7a1cb07c 100644 --- a/src/StoreMetaVary.cc +++ b/src/StoreMetaVary.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaVary.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaVary.cc,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -58,12 +58,6 @@ StoreMetaVary::operator delete (void *address) memPoolFree(pool, address); } -void -StoreMetaVary::deleteSelf() -{ - delete this; -} - bool StoreMetaVary::checkConsistency(StoreEntry *e) const { diff --git a/src/StoreMetaVary.h b/src/StoreMetaVary.h index 269a04238d..0b1d80576b 100644 --- a/src/StoreMetaVary.h +++ b/src/StoreMetaVary.h @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaVary.h,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaVary.h,v 1.3 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,7 +42,6 @@ class StoreMetaVary : public StoreMeta public: void *operator new (size_t); void operator delete (void *); - void deleteSelf(); char getType() const {return STORE_META_VARY_HEADERS;} diff --git a/src/StoreSwapLogData.cc b/src/StoreSwapLogData.cc index e0a8f6a455..f8bfc55491 100644 --- a/src/StoreSwapLogData.cc +++ b/src/StoreSwapLogData.cc @@ -1,5 +1,5 @@ /* - * $Id: StoreSwapLogData.cc,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * $Id: StoreSwapLogData.cc,v 1.2 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -58,9 +58,3 @@ StoreSwapLogData::operator delete (void *address) { memPoolFree (Pool, address); } - -void -StoreSwapLogData::deleteSelf() const -{ - delete this; -} diff --git a/src/StoreSwapLogData.h b/src/StoreSwapLogData.h index 338cd70784..3681fa442b 100644 --- a/src/StoreSwapLogData.h +++ b/src/StoreSwapLogData.h @@ -1,6 +1,6 @@ /* - * $Id: StoreSwapLogData.h,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * $Id: StoreSwapLogData.h,v 1.2 2003/08/04 22:14:41 robertc Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -51,7 +51,6 @@ class StoreSwapLogData public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; StoreSwapLogData(); char op; sfileno swap_filen; diff --git a/src/acl.cc b/src/acl.cc index bc04dfcf0e..40d7fe393f 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.309 2003/07/16 05:27:17 robertc Exp $ + * $Id: acl.cc,v 1.310 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -149,7 +149,7 @@ ACL::ParseAclLine(acl ** head) if (!A->valid()) { debug(28, 0) ("aclParseAclLine: IGNORING invalid ACL: %s\n", A->cfgline); - A->deleteSelf(); + delete A; /* Do we need this? */ A = NULL; return; @@ -359,7 +359,7 @@ aclParseAclList(acl_list ** head) debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); debug(28, 0) ("aclParseAccessLine: ACL name '%s' not found.\n", t); - L->deleteSelf(); + delete L; continue; } @@ -559,7 +559,7 @@ aclDestroyAcls(acl ** head) for (acl *a = *head; a; a = next) { next = a->next; - a->deleteSelf(); + delete a; } *head = NULL; @@ -578,7 +578,7 @@ aclDestroyAclList(acl_list ** head) for (l = *head; l; l = *head) { *head = l->next; - l->deleteSelf(); + delete l; } } @@ -687,12 +687,6 @@ ACLList::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLList::deleteSelf() const -{ - delete this; -} - CBDATA_CLASS_INIT(acl_access); void * @@ -710,12 +704,6 @@ acl_access::operator delete (void *address) cbdataFree(t); } -void -acl_access::deleteSelf () const -{ - delete this; -} - ACL::Prototype::Prototype() : prototype (NULL), typeString (NULL) {} ACL::Prototype::Prototype (ACL const *aPrototype, char const *aType) : prototype (aPrototype), typeString (aType) diff --git a/src/asn.cc b/src/asn.cc index 4df85f6c81..a9a3c648e7 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -1,6 +1,6 @@ /* - * $Id: asn.cc,v 1.95 2003/07/14 14:15:58 robertc Exp $ + * $Id: asn.cc,v 1.96 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -497,10 +497,10 @@ destroyRadixNodeInfo(as_info * e_info) while (data) { prev = data; data = data->next; - prev->deleteSelf(); + delete prev; } - data->deleteSelf(); + delete data; } static int @@ -567,16 +567,10 @@ ACLASN::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLASN::deleteSelf() const -{ - delete this; -} - ACLASN::~ACLASN() { if (data) - data->deleteSelf(); + delete data; } bool diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 6b58848b95..8deaa15472 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.cc,v 1.27 2003/07/14 14:16:21 robertc Exp $ + * $Id: auth_digest.cc,v 1.28 2003/08/04 22:14:48 robertc Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -1529,12 +1529,6 @@ digest_user_h::operator delete (void *address) memPoolFree (Pool, address); } -void -digest_user_h::deleteSelf() const -{ - delete this; -} - digest_user_h::digest_user_h () : username (NULL), HA1created (0) {} @@ -1557,12 +1551,6 @@ digest_request_h::operator delete (void *address) memPoolFree (Pool, address); } -void -digest_request_h::deleteSelf() const -{ - delete this; -} - digest_request_h::digest_request_h () : theUser (NULL) , credentials_ok (Unchecked) {} diff --git a/src/auth/digest/auth_digest.h b/src/auth/digest/auth_digest.h index 37c35936f0..bb97c24b5d 100644 --- a/src/auth/digest/auth_digest.h +++ b/src/auth/digest/auth_digest.h @@ -28,7 +28,6 @@ class digest_user_h public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; digest_user_h(); ~digest_user_h(); @@ -53,7 +52,6 @@ public: enum CredentialsState {Unchecked, Ok, Pending, Failed}; void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; digest_request_h(); digest_request_h(auth_user_t *); diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index c4d1ac1c5d..de59eb232c 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.cc,v 1.35 2003/08/03 08:09:30 robertc Exp $ + * $Id: auth_ntlm.cc,v 1.36 2003/08/04 22:14:53 robertc Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins @@ -1254,9 +1254,3 @@ ntlm_request_t::operator delete (void *address) { memPoolFree (Pool, address); } - -void -ntlm_request_t::deleteSelf() const -{ - delete this; -} diff --git a/src/auth/ntlm/auth_ntlm.h b/src/auth/ntlm/auth_ntlm.h index 94fd2382d5..a0a1b4eb55 100644 --- a/src/auth/ntlm/auth_ntlm.h +++ b/src/auth/ntlm/auth_ntlm.h @@ -42,7 +42,6 @@ class ntlm_request_t : public AuthUserRequestState public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; ~ntlm_request_t(); virtual int authenticated() const; diff --git a/src/authenticate.cc b/src/authenticate.cc index 010119703b..53c2fea52b 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.61 2003/07/29 11:34:56 robertc Exp $ + * $Id: authenticate.cc,v 1.62 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -294,7 +294,7 @@ AuthUserRequest::~AuthUserRequest() if (authscheme_list[auth_user->auth_module - 1].requestFree != NULL) authscheme_list[auth_user->auth_module - 1].requestFree(this); else { - state()->deleteSelf(); + delete state(); state(NULL); } } diff --git a/src/authenticate.h b/src/authenticate.h index 3ebfa60b5f..ad84cffd03 100644 --- a/src/authenticate.h +++ b/src/authenticate.h @@ -1,6 +1,6 @@ /* - * $Id: authenticate.h,v 1.11 2003/07/14 14:15:59 robertc Exp $ + * $Id: authenticate.h,v 1.12 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -118,7 +118,6 @@ class AuthUserRequestState public: void *operator new (size_t); void operator delete (void *); - virtual void deleteSelf() const = 0; virtual ~AuthUserRequestState(){} virtual int authenticated() const = 0; diff --git a/src/client_side.cc b/src/client_side.cc index 23f2b8369e..1818d70333 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.651 2003/07/15 06:50:41 robertc Exp $ + * $Id: client_side.cc,v 1.652 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -112,12 +112,6 @@ ClientSocketContext::operator delete (void *address) cbdataFree (address); } -void -ClientSocketContext::deleteSelf() const -{ - delete this; -} - /* Local functions */ /* ClientSocketContext */ static ClientSocketContext *ClientSocketContextNew(clientHttpRequest *); @@ -1088,7 +1082,7 @@ ClientSocketContext::buildRangeHeader(HttpReply * rep) if (range_err) { /* XXX Why do we do this here, and not when parsing the request ? */ debug(33, 3) ("clientBuildRangeHeader: will not do ranges: %s.\n", range_err); - http->request->range->deleteSelf(); + delete http->request->range; http->request->range = NULL; } else { /* XXX: TODO: Review, this unconditional set may be wrong. - TODO: review. */ @@ -3071,12 +3065,6 @@ ConnStateData::operator delete (void *address) cbdataFree(t); } -void -ConnStateData::deleteSelf () const -{ - delete this; -} - ConnStateData::ConnStateData() : transparent_ (false), reading_ (false), openReference (this) {} diff --git a/src/client_side.h b/src/client_side.h index b15751a108..a502e44144 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -1,6 +1,6 @@ /* - * $Id: client_side.h,v 1.5 2003/07/12 12:39:56 robertc Exp $ + * $Id: client_side.h,v 1.6 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -50,7 +50,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete(void *); - void deleteSelf() const; ClientSocketContext(); ~ClientSocketContext(); bool startOfOutput() const; @@ -127,7 +126,6 @@ public: typedef RefCount Pointer; void * operator new (size_t); void operator delete (void *); - void deleteSelf() const; ConnStateData(); ~ConnStateData(); diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 344a090a85..a0db432870 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.62 2003/07/23 11:21:37 robertc Exp $ + * $Id: client_side_reply.cc,v 1.63 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -155,12 +155,6 @@ clientReplyContext::operator delete (void *address) cbdataFree (tmp); } -void -clientReplyContext::deleteSelf() const -{ - delete this; -} - void clientReplyContext::saveState() { diff --git a/src/client_side_reply.h b/src/client_side_reply.h index 5c8a5237b3..f6e4b32708 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.h,v 1.4 2003/06/20 01:01:00 robertc Exp $ + * $Id: client_side_reply.h,v 1.5 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -49,7 +49,6 @@ class clientReplyContext : public RefCountable, public StoreClient public: void *operator new (size_t byteCount); void operator delete (void *address); - void deleteSelf() const; static STCB CacheHit; static STCB HandleIMSReply; static STCB SendMoreData; diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 5763cd3c7b..506a55dbff 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.29 2003/08/03 08:09:26 robertc Exp $ + * $Id: client_side_request.cc,v 1.30 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -66,7 +66,6 @@ class ClientRequestContext : public RefCountable public: void *operator new(size_t); void operator delete(void *); - void deleteSelf() const; ClientRequestContext(); ClientRequestContext(ClientHttpRequest *); @@ -107,12 +106,6 @@ ClientRequestContext::operator delete (void *address) cbdataReferenceDone (t); } -void -ClientRequestContext::deleteSelf() const -{ - delete this; -} - /* Local functions */ /* other */ static void clientAccessCheckDone(int, void *); @@ -131,7 +124,7 @@ ClientRequestContext::~ClientRequestContext() cbdataReferenceDone(http); if (acl_checklist) - acl_checklist->deleteSelf(); + delete acl_checklist; } ClientRequestContext::ClientRequestContext() : acl_checklist (NULL), redirect_state (REDIRECT_NONE), http(NULL) @@ -165,12 +158,6 @@ ClientHttpRequest::operator delete (void *address) cbdataReferenceDone (temp); } -void -ClientHttpRequest::deleteSelf() const -{ - delete this; -} - ClientHttpRequest::ClientHttpRequest() { /* reset range iterator */ @@ -384,7 +371,7 @@ clientAccessCheckDone(int answer, void *data) clientHttpRequest *http_ = context->http; if (!cbdataReferenceValid (http_)) { - context->deleteSelf(); + delete context; return; } @@ -409,7 +396,7 @@ clientAccessCheckDone(int answer, void *data) } else { /* Send an error */ clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->prev->data; - context->deleteSelf(); + delete context; debug(85, 5) ("Access Denied: %s\n", http->uri); debug(85, 5) ("AclMatchedName = %s\n", AclMatchedName ? AclMatchedName : ""); @@ -719,7 +706,7 @@ clientRedirectDone(void *data, char *result) clientHttpRequest *http_ = context->http; if (!cbdataReferenceValid (http_)) { - context->deleteSelf(); + delete context; return; } @@ -826,11 +813,11 @@ ClientRequestContext::checkNoCacheDone(int answer) clientHttpRequest *http_ = http; if (!cbdataReferenceValid (http_)) { - deleteSelf(); + delete this; return; } - deleteSelf(); + delete this; http_->request->flags.cachable = answer; http_->processRequest(); } diff --git a/src/client_side_request.h b/src/client_side_request.h index fa6dccf6ff..8f8dde0ca4 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.h,v 1.15 2003/07/14 14:16:00 robertc Exp $ + * $Id: client_side_request.h,v 1.16 2003/08/04 22:14:41 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -53,7 +53,6 @@ class ClientHttpRequest public: void *operator new (size_t); void operator delete (void *); - void deleteSelf() const; ClientHttpRequest(); ~ClientHttpRequest(); diff --git a/src/comm.cc b/src/comm.cc index 453f0bfcbc..eb3ec33bc3 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.385 2003/08/03 09:21:29 robertc Exp $ + * $Id: comm.cc,v 1.386 2003/08/04 22:14:41 robertc Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -55,7 +55,6 @@ class ConnectStateData public: void *operator new (size_t); void operator delete (void *); - void deleteSelf() const; static void Connect (int fd, void *me); void connect(); void callCallback(comm_err_t status, int xerrno); @@ -213,7 +212,6 @@ class CommCallbackData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; CommCallbackData(CommCommonCallback const &); virtual ~CommCallbackData() {} @@ -244,7 +242,6 @@ class CommReadCallbackData : public CommCallbackData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; CommReadCallbackData(CommCommonCallback const &, CallBack aCallback, int); virtual comm_callback_t getType() const { return COMM_CB_READ; } @@ -262,7 +259,6 @@ class CommAcceptCallbackData : public CommCallbackData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; CommAcceptCallbackData(int const anFd, CallBack, comm_err_t, int, int, ConnectionDetail const &); virtual void callCallback(); @@ -279,7 +275,6 @@ class CommFillCallbackData : public CommCallbackData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; CommFillCallbackData(int const anFd, CallBack aCallback, comm_err_t, int); virtual void callCallback(); @@ -294,7 +289,6 @@ class CommWriteCallbackData : public CommCallbackData public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; CommWriteCallbackData(int const anFd, CallBack aCallback, comm_err_t, int, int); virtual void callCallback(); @@ -340,12 +334,6 @@ CommCallbackData::operator delete (void *address) memPoolFree (Pool, address); } -void -CommCallbackData::deleteSelf() const -{ - delete this; -} - MemPool (*CommReadCallbackData::Pool)(NULL); void * CommReadCallbackData::operator new (size_t byteCount) @@ -365,12 +353,6 @@ CommReadCallbackData::operator delete (void *address) memPoolFree (Pool, address); } -void -CommReadCallbackData::deleteSelf() const -{ - delete this; -} - MemPool (*CommAcceptCallbackData::Pool)(NULL); void * CommAcceptCallbackData::operator new (size_t byteCount) @@ -390,12 +372,6 @@ CommAcceptCallbackData::operator delete (void *address) memPoolFree (Pool, address); } -void -CommAcceptCallbackData::deleteSelf() const -{ - delete this; -} - MemPool (*CommFillCallbackData::Pool)(NULL); void * CommFillCallbackData::operator new (size_t byteCount) @@ -415,13 +391,6 @@ CommFillCallbackData::operator delete (void *address) memPoolFree (Pool, address); } -void -CommFillCallbackData::deleteSelf() const -{ - delete this; -} - - MemPool (*CommWriteCallbackData::Pool)(NULL); void * CommWriteCallbackData::operator new (size_t byteCount) @@ -441,12 +410,6 @@ CommWriteCallbackData::operator delete (void *address) memPoolFree (Pool, address); } -void -CommWriteCallbackData::deleteSelf() const -{ - delete this; -} - CommCallbackData::CommCallbackData(CommCommonCallback const &newResults) : result (newResults) { assert(fdc_table[result.fd].active == 1); @@ -595,7 +558,7 @@ comm_calliocallback(void) dlink_node *node = (dlink_node *)CommCallbackList.head; cio = (CommCallbackData *)node->data; cio->callACallback(); - cio->deleteSelf(); + delete cio; } PROF_stop(comm_calliocallback); @@ -1283,12 +1246,6 @@ ConnectStateData::operator delete (void *address) cbdataFree(address); } -void -ConnectStateData::deleteSelf() const -{ - delete this; -} - void commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data) { @@ -1356,7 +1313,7 @@ commConnectFree(int fd, void *data) debug(5, 3) ("commConnectFree: FD %d\n", fd); cbdataReferenceDone(cs->callback.data); safe_free(cs->host); - cs->deleteSelf(); + delete cs; } static void @@ -1864,7 +1821,7 @@ _comm_close(int fd, char const *file, int line) /* We're closing! */ cio->fdClosing(); cio->callACallback(); - cio->deleteSelf(); + delete cio; } commCallCloseHandlers(fd); diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 5e64625a75..2d32f656b1 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.cc,v 1.41 2003/08/03 09:03:49 robertc Exp $ + * $Id: delay_pools.cc,v 1.42 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -69,7 +69,6 @@ public: typedef RefCount Pointer; void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Aggregate(); ~Aggregate(); virtual DelaySpec *rate() {return &spec;} @@ -91,7 +90,6 @@ class AggregateId:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; AggregateId (RefCount); virtual int bytesWanted (int min, int max) const; virtual void bytesIn(int qty); @@ -161,7 +159,6 @@ class Id:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Id (RefCount, int); virtual int bytesWanted (int min, int max) const; virtual void bytesIn(int qty); @@ -178,7 +175,6 @@ class IndividualPool : public VectorPool public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; protected: virtual char const *label() const {return "Individual";} @@ -193,7 +189,6 @@ class ClassCNetPool : public VectorPool public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; protected: virtual char const *label() const {return "Network";} @@ -258,7 +253,6 @@ class Id:public DelayIdComposite public: void *operator new(size_t); void operator delete (void *); - virtual void deleteSelf() const; Id (RefCount, unsigned char, unsigned char); virtual int bytesWanted (int min, int max) const; virtual void bytesIn(int qty); @@ -290,12 +284,6 @@ CommonPool::operator delete (void *address) ::operator delete (address); } -void -CommonPool::deleteSelf() const -{ - delete this; -} - CommonPool * CommonPool::Factory(unsigned char _class, CompositePoolNode::Pointer& compositeCopy) { @@ -441,12 +429,6 @@ CompositePoolNode::operator delete (void *address) ::operator delete (address); } -void -CompositePoolNode::deleteSelf() const -{ - delete this; -} - void * Aggregate::operator new(size_t size) { @@ -461,12 +443,6 @@ Aggregate::operator delete (void *address) ::operator delete (address); } -void -Aggregate::deleteSelf() const -{ - delete this; -} - Aggregate::Aggregate() { theBucket.init (*rate()); @@ -536,12 +512,6 @@ Aggregate::AggregateId::operator delete (void *address) ::operator delete (address); } -void -Aggregate::AggregateId::deleteSelf() const -{ - delete this; -} - Aggregate::AggregateId::AggregateId(RefCount anAggregate) : theAggregate(anAggregate) {} @@ -732,12 +702,6 @@ IndividualPool::operator delete (void *address) ::operator delete (address); } -void -IndividualPool::deleteSelf() const -{ - delete this; -} - VectorPool::VectorPool() { DelayPools::registerForUpdates (this); @@ -855,12 +819,6 @@ VectorPool::Id::operator delete (void *address) ::operator delete (address); } -void -VectorPool::Id::deleteSelf() const -{ - delete this; -} - VectorPool::Id::Id (VectorPool::Pointer aPool, int anIndex) : theVector (aPool), theIndex (anIndex) {} @@ -900,12 +858,6 @@ ClassCNetPool::operator delete (void *address) ::operator delete (address); } -void -ClassCNetPool::deleteSelf() const -{ - delete this; -} - unsigned int const ClassCNetPool::makeKey (struct in_addr &src_addr) const @@ -1033,12 +985,6 @@ ClassCHostPool::Id::operator delete (void *address) ::operator delete (address); } -void -ClassCHostPool::Id::deleteSelf() const -{ - delete this; -} - ClassCHostPool::Id::Id (ClassCHostPool::Pointer aPool, unsigned char aNet, unsigned char aHost) : theClassCHost (aPool), theNet (aNet), theHost (aHost) {} diff --git a/src/external_acl.cc b/src/external_acl.cc index 84d4cb0992..aa2dab360a 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -1,6 +1,6 @@ /* - * $Id: external_acl.cc,v 1.51 2003/07/14 08:21:56 robertc Exp $ + * $Id: external_acl.cc,v 1.52 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -882,7 +882,7 @@ external_acl_cache_delete(external_acl * def, external_acl_entry * entry) hash_remove_link(def->cache, entry); dlinkDelete(&entry->lru, &def->lru_list); def->cache_entries -= 1; - entry->deleteSelf(); + delete entry; } /****************************************************************** @@ -1250,12 +1250,6 @@ ACLExternal::operator delete (void *address) memPoolFree (Pool, address); } -void -ACLExternal::deleteSelf() const -{ - delete this; -} - char const * ACLExternal::typeString() const { diff --git a/src/fs/aufs/store_asyncufs.h b/src/fs/aufs/store_asyncufs.h index 2c498763a8..9e7284e7db 100644 --- a/src/fs/aufs/store_asyncufs.h +++ b/src/fs/aufs/store_asyncufs.h @@ -89,7 +89,6 @@ class AUFSFile : public DiskFile { public: - virtual void deleteSelf() const; void * operator new (size_t); void operator delete (void *); AUFSFile (char const *path, AufsIO *); @@ -165,7 +164,6 @@ public: AufsIO(); virtual bool shedLoad(); virtual int load(); - virtual void deleteSelf() const; virtual StoreIOState::Pointer createState(SwapDir *SD, StoreEntry *e, STIOCB * callback, void *callback_data) const; virtual DiskFile::Pointer newFile(char const *path); virtual void unlinkFile (char const *); diff --git a/src/fs/aufs/store_io_aufs.cc b/src/fs/aufs/store_io_aufs.cc index ed826e479f..c0acdfe62b 100644 --- a/src/fs/aufs/store_io_aufs.cc +++ b/src/fs/aufs/store_io_aufs.cc @@ -50,12 +50,6 @@ AufsIO::load() return loadav; } -void -AufsIO::deleteSelf() const -{ - /* do nothing, we use a single instance */ -} - StoreIOState::Pointer AufsIO::createState(SwapDir *SD, StoreEntry *e, STIOCB * callback, void *callback_data) const { @@ -130,9 +124,6 @@ AUFSFile::operator delete (void *address) cbdataReferenceDone (t); } -void -AUFSFile::deleteSelf() const {delete this;} - AUFSFile::AUFSFile (char const *aPath, AufsIO *anIO):fd(-1), errorOccured (false), IO(anIO), inProgressIOs (0) { diff --git a/src/fs/coss/store_coss.h b/src/fs/coss/store_coss.h index e8c4ea0c94..0c0970a293 100644 --- a/src/fs/coss/store_coss.h +++ b/src/fs/coss/store_coss.h @@ -63,8 +63,6 @@ class CossState : public storeIOState { public: - virtual void deleteSelf() const {delete this;} - void * operator new (size_t); void operator delete (void *); CossState(CossSwapDir *); diff --git a/src/fs/diskd/store_diskd.h b/src/fs/diskd/store_diskd.h index 166d258c99..d2522493ef 100644 --- a/src/fs/diskd/store_diskd.h +++ b/src/fs/diskd/store_diskd.h @@ -25,7 +25,6 @@ class DiskdFile : public DiskFile { public: - virtual void deleteSelf() const; void * operator new (size_t); void operator delete (void *); DiskdFile (char const *path, DiskdIO *); @@ -139,7 +138,6 @@ class DiskdIO : public UFSStrategy public: DiskdIO(); virtual bool shedLoad(); - virtual void deleteSelf() const; virtual void openFailed(); virtual int load(); virtual StoreIOState::Pointer createState(SwapDir *SD, StoreEntry *e, STIOCB * callback, void *callback_data) const; diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index dc1327eae5..2ab018eaf7 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_io_diskd.cc,v 1.35 2003/07/29 11:34:57 robertc Exp $ + * $Id: store_io_diskd.cc,v 1.36 2003/08/04 22:14:53 robertc Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -83,12 +83,6 @@ DiskdIO::load() return away * 1000 / magic2; } -void -DiskdIO::deleteSelf() const -{ - /* do nothing, we use a single instance */ -} - void DiskdIO::openFailed() { @@ -256,9 +250,6 @@ DiskdFile::operator delete (void *address) cbdataReferenceDone (t); } -void -DiskdFile::deleteSelf() const {delete this;} - DiskdFile::DiskdFile (char const *aPath, DiskdIO *anIO) : errorOccured (false), IO(anIO), inProgressIOs (0) { diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 387cb4a87e..4e109ed281 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.61 2003/08/03 10:05:20 robertc Exp $ + * $Id: store_dir_ufs.cc,v 1.62 2003/08/04 22:14:53 robertc Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -196,7 +196,7 @@ UFSSwapDir::~UFSSwapDir() filemapFreeMemory(map); if (IO) - IO->deleteSelf(); + delete IO; IO = NULL; } diff --git a/src/fs/ufs/store_io_ufs.cc b/src/fs/ufs/store_io_ufs.cc index cc3f38e3bf..b7bd27016e 100644 --- a/src/fs/ufs/store_io_ufs.cc +++ b/src/fs/ufs/store_io_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_io_ufs.cc,v 1.21 2003/07/28 09:27:29 robertc Exp $ + * $Id: store_io_ufs.cc,v 1.22 2003/08/04 22:14:53 robertc Exp $ * * DEBUG: section 79 Storage Manager UFS Interface * AUTHOR: Duane Wessels @@ -54,12 +54,6 @@ UfsIO::load() return 999; } -void -UfsIO::deleteSelf() const -{ - /* Do nothing, we use a single instance */ -} - StoreIOState::Pointer UfsIO::createState(SwapDir *SD, StoreEntry *e, STIOCB * callback, void *callback_data) const { @@ -122,9 +116,6 @@ UFSFile::operator delete (void *address) cbdataReferenceDone (t); } -void -UFSFile::deleteSelf() const {delete this;} - UFSFile::UFSFile (char const *aPath) : fd (-1), closed (true), error_(false) { assert (aPath); diff --git a/src/fs/ufs/store_ufs.h b/src/fs/ufs/store_ufs.h index afe7b490f5..e60643e69d 100644 --- a/src/fs/ufs/store_ufs.h +++ b/src/fs/ufs/store_ufs.h @@ -15,7 +15,6 @@ class UFSFile : public DiskFile public: void *operator new(size_t); void operator delete(void *); - virtual void deleteSelf() const; UFSFile (char const *path); ~UFSFile(); virtual void open (int, mode_t, IORequestor::Pointer); @@ -56,7 +55,6 @@ class UfsIO : public UFSStrategy public: virtual bool shedLoad(); virtual int load(); - virtual void deleteSelf() const; virtual StoreIOState::Pointer createState(SwapDir *SD, StoreEntry *e, STIOCB * callback, void *callback_data) const; virtual DiskFile::Pointer newFile (char const *path); virtual void unlinkFile (char const *); diff --git a/src/ftp.cc b/src/ftp.cc index fd5f8ac15a..f2ffeb9825 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.350 2003/06/20 01:01:00 robertc Exp $ + * $Id: ftp.cc,v 1.351 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -136,7 +136,6 @@ class FtpStateData public: void *operator new (size_t); void operator delete (void *); - void deleteSelf() const; ~FtpStateData(); StoreEntry *entry; request_t *request; @@ -215,12 +214,6 @@ FtpStateData::operator delete (void *address) cbdataFree(t); } -void -FtpStateData::deleteSelf () const -{ - delete this; -} - typedef struct { char type; @@ -359,7 +352,7 @@ static void ftpStateFree(int fdnotused, void *data) { FtpStateData *ftpState = (FtpStateData *)data; - ftpState->deleteSelf(); + delete ftpState; } FtpStateData::~FtpStateData() diff --git a/src/helper.cc b/src/helper.cc index 24e7d849aa..599c34bbc1 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -1,6 +1,6 @@ /* - * $Id: helper.cc,v 1.59 2003/07/15 11:33:22 robertc Exp $ + * $Id: helper.cc,v 1.60 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -1452,7 +1452,7 @@ helperRequestFree(helper_request * r) { cbdataReferenceDone(r->data); xfree(r->buf); - r->deleteSelf(); + delete r; } MemPool (*helper_request::Pool)(NULL); @@ -1475,18 +1475,12 @@ helper_request::operator delete (void *address) memPoolFree (Pool, address); } -void -helper_request::deleteSelf() const -{ - delete this; -} - static void helperStatefulRequestFree(helper_stateful_request * r) { cbdataReferenceDone(r->data); xfree(r->buf); - r->deleteSelf(); + delete r; } MemPool (*helper_stateful_request::Pool)(NULL); @@ -1508,9 +1502,3 @@ helper_stateful_request::operator delete (void *address) { memPoolFree (Pool, address); } - -void -helper_stateful_request::deleteSelf() const -{ - delete this; -} diff --git a/src/helper.h b/src/helper.h index dc107978d4..639ca1f220 100644 --- a/src/helper.h +++ b/src/helper.h @@ -1,6 +1,6 @@ /* - * $Id: helper.h,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * $Id: helper.h,v 1.2 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -44,7 +44,6 @@ class helper_request public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; char *buf; HLPCB *callback; void *data; @@ -61,7 +60,6 @@ class helper_stateful_request public: void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; char *buf; HLPSCB *callback; int placeholder; /* if 1, this is a dummy request waiting for a stateful helper to become available for deferred requests.*/ diff --git a/src/http.cc b/src/http.cc index f67ba92f81..aff8ca7b15 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.424 2003/07/29 11:34:56 robertc Exp $ + * $Id: http.cc,v 1.425 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1145,7 +1145,7 @@ httpBuildRequestHeader(request_t * request, /* don't cache the result */ orig_request->flags.cachable = 0; /* pretend it's not a range request */ - orig_request->range->deleteSelf(); + delete orig_request->range; orig_request->range = NULL; orig_request->flags.range = 0; } diff --git a/src/mem_node.cc b/src/mem_node.cc index 88cea9203f..c9d61d960d 100644 --- a/src/mem_node.cc +++ b/src/mem_node.cc @@ -1,6 +1,6 @@ /* - * $Id: mem_node.cc,v 1.4 2003/06/26 12:51:57 robertc Exp $ + * $Id: mem_node.cc,v 1.5 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Robert Collins @@ -57,12 +57,6 @@ mem_node::operator delete (void *address) memPoolFree(pool, address); } -void -mem_node::deleteSelf() const -{ - delete this; -} - mem_node::mem_node(off_t offset):nodeBuffer(0,offset,data) {} diff --git a/src/mem_node.h b/src/mem_node.h index bd47f181e2..016c63d976 100644 --- a/src/mem_node.h +++ b/src/mem_node.h @@ -1,6 +1,6 @@ /* - * $Id: mem_node.h,v 1.4 2003/06/26 12:51:57 robertc Exp $ + * $Id: mem_node.h,v 1.5 2003/08/04 22:14:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -46,7 +46,6 @@ public: void operator delete (void *); void *operator new (size_t); - void deleteSelf() const; mem_node(off_t); ~mem_node(); size_t space() const; diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 319c44b783..6fa69c5f2f 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.97 2003/07/16 20:22:26 wessels Exp $ + * $Id: peer_digest.cc,v 1.98 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -122,12 +122,6 @@ PeerDigest::operator delete (void *address) cbdataFree(t); } -void -PeerDigest::deleteSelf () const -{ - delete this; -} - /* allocate new peer digest, call Init, and lock everything */ PeerDigest * peerDigestCreate(peer * p) @@ -156,7 +150,7 @@ peerDigestDestroy(PeerDigest * pd) peerDigestClean(pd); - pd->deleteSelf(); + delete pd; } /* called by peer to indicate that somebody actually needs this digest */ diff --git a/src/protos.h b/src/protos.h index b7a2a5e3c4..ebfe540abf 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.486 2003/07/28 09:27:28 robertc Exp $ + * $Id: protos.h,v 1.487 2003/08/04 22:14:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -210,7 +210,7 @@ void FreeObject(void *address) { O *anObject = static_cast (address); - anObject->deleteSelf(); + delete anObject; } SQUIDCEXTERN void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *); diff --git a/src/stmem.cc b/src/stmem.cc index f44d6f6f8a..5a0713fe68 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -1,6 +1,6 @@ /* - * $Id: stmem.cc,v 1.79 2003/06/26 12:51:57 robertc Exp $ + * $Id: stmem.cc,v 1.80 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -75,7 +75,7 @@ void mem_hdr::unlink(mem_node *aNode) { nodes.remove (aNode, NodeCompare); - aNode->deleteSelf(); + delete aNode; } int diff --git a/src/store_swapmeta.cc b/src/store_swapmeta.cc index c0a8bc7cae..fbacf6f9d9 100644 --- a/src/store_swapmeta.cc +++ b/src/store_swapmeta.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.cc,v 1.21 2003/02/21 22:50:12 robertc Exp $ + * $Id: store_swapmeta.cc,v 1.22 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -47,7 +47,7 @@ storeSwapTLVFree(tlv * n) while ((t = n) != NULL) { n = t->next; xfree(t->value); - t->deleteSelf(); + delete t; } } diff --git a/src/structs.h b/src/structs.h index ed6ab210b8..0a82b849dc 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.476 2003/07/22 15:23:02 robertc Exp $ + * $Id: structs.h,v 1.477 2003/08/04 22:14:42 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1146,7 +1146,6 @@ class PeerDigest public: void *operator new (size_t); void operator delete(void *); - void deleteSelf() const; struct _peer *peer; /* pointer back to peer structure, argh */ CacheDigest *cd; /* actual digest structure */ diff --git a/src/tunnel.cc b/src/tunnel.cc index 9a2485d808..95578356ac 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.143 2003/07/15 06:50:43 robertc Exp $ + * $Id: tunnel.cc,v 1.144 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -52,7 +52,6 @@ public: class Connection; void *operator new(size_t); void operator delete (void *); - void deleteSelf() const; static void ReadClient(int fd, char *buf, size_t len, comm_err_t errcode, int xerrno, void *data); static void ReadServer(int fd, char *buf, size_t len, comm_err_t errcode, int xerrno, void *data); static void WriteClientDone(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data); @@ -159,7 +158,7 @@ sslStateFree(SslStateData * sslState) sslState->host = NULL; requestUnlink(sslState->request); sslState->request = NULL; - sslState->deleteSelf(); + delete sslState; } SslStateData::Connection::~Connection() @@ -736,12 +735,6 @@ SslStateData::operator delete (void *address) cbdataFree(t); } -void -SslStateData::deleteSelf () const -{ - delete this; -} - void SslStateData::Connection::fd(int const newFD) { diff --git a/src/ufscommon.cc b/src/ufscommon.cc index ebd8deee1c..7010005ec3 100644 --- a/src/ufscommon.cc +++ b/src/ufscommon.cc @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.10 2003/07/15 11:33:22 robertc Exp $ + * $Id: ufscommon.cc,v 1.11 2003/08/04 22:14:42 robertc Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Robert Collins @@ -65,12 +65,6 @@ RebuildState::operator delete (void *address) cbdataReferenceDone (t); } -void -RebuildState::deleteSelf() const -{ - delete this; -} - RebuildState::~RebuildState() { store_dirs_rebuilding--; @@ -136,7 +130,7 @@ RebuildState::rebuildFromDirectory() if (fd == -2) { debug(47, 1) ("Done scanning %s swaplog (%d entries)\n", sd->path, n_read); - deleteSelf(); + delete this; return; } else if (fd < 0) { continue; diff --git a/src/ufscommon.h b/src/ufscommon.h index df45019510..4edf10b85b 100644 --- a/src/ufscommon.h +++ b/src/ufscommon.h @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.7 2003/07/22 15:23:03 robertc Exp $ + * $Id: ufscommon.h,v 1.8 2003/08/04 22:14:42 robertc Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -151,7 +151,6 @@ class DiskFile : public RefCountable public: typedef RefCount Pointer; - virtual void deleteSelf() const = 0; virtual void open (int, mode_t, IORequestor::Pointer) = 0; virtual void create (int, mode_t, IORequestor::Pointer) = 0; virtual void read(char *, off_t, size_t) = 0; @@ -176,7 +175,6 @@ class UFSStrategy public: virtual bool shedLoad() = 0; - virtual void deleteSelf() const = 0; virtual void openFailed(){} virtual int load(){return -1;} @@ -259,9 +257,6 @@ public: operator C *() {return const_cast(theInstance);} - // This will go when we remove the deleteSelf idiom - virtual void deleteSelf() const {delete const_cast(this);} - private: C const *theInstance; }; @@ -272,8 +267,6 @@ class UFSStoreState : public storeIOState, public IORequestor { public: - virtual void deleteSelf() const {delete this;} - void * operator new (size_t); void operator delete (void *); UFSStoreState(SwapDir * SD, StoreEntry * anEntry, STIOCB * callback_, void *callback_data_); @@ -354,7 +347,6 @@ class RebuildState : public RefCountable public: void *operator new(size_t); void operator delete(void *); - void deleteSelf() const; static EVH RebuildFromDirectory; static EVH RebuildFromSwapLog; diff --git a/test-suite/http_range_test.cc b/test-suite/http_range_test.cc index ce8bfa2b37..114dd5d748 100644 --- a/test-suite/http_range_test.cc +++ b/test-suite/http_range_test.cc @@ -1,6 +1,6 @@ /* - * $Id: http_range_test.cc,v 1.8 2003/08/03 22:06:10 robertc Exp $ + * $Id: http_range_test.cc,v 1.9 2003/08/04 22:14:56 robertc Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -171,7 +171,7 @@ testRangeParser(char const *rangestring) assert (*pos); - range->deleteSelf(); + delete range; } HttpHdrRange * @@ -221,7 +221,7 @@ testRangeCanonization() assert (range->specs.count == 3); - range->deleteSelf(); + delete range; range=rangeFromString("bytes=0-3, 1-, -2"); @@ -231,7 +231,7 @@ testRangeCanonization() if (!range->canonize(4)) exit(1); - range->deleteSelf(); + delete range; range=rangeFromString("bytes=3-6"); @@ -241,7 +241,7 @@ testRangeCanonization() if (range->canonize(3)) exit(1); - range->deleteSelf(); + delete range; range=rangeFromString("bytes=3-6"); @@ -251,7 +251,7 @@ testRangeCanonization() if (!range->canonize(4)) exit(1); - range->deleteSelf(); + delete range; range=rangeFromString("bytes=1-1,2-3"); @@ -262,7 +262,7 @@ testRangeCanonization() assert (range->specs.count == 2); - range->deleteSelf(); + delete range; } int diff --git a/test-suite/mem_node_test.cc b/test-suite/mem_node_test.cc index e3fe8db6c1..92a5880a5d 100644 --- a/test-suite/mem_node_test.cc +++ b/test-suite/mem_node_test.cc @@ -1,6 +1,6 @@ /* - * $Id: mem_node_test.cc,v 1.4 2003/06/26 12:52:00 robertc Exp $ + * $Id: mem_node_test.cc,v 1.5 2003/08/04 22:14:57 robertc Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Robert Collins @@ -79,7 +79,7 @@ main (int argc, char *argv) assert (mem_node (0) < mem_node (2)); assert (!(mem_node (0) < mem_node (0))); assert (!(mem_node (2) < mem_node (0))); - aNode->deleteSelf(); + delete aNode; assert (mem_node::InUseCount() == 0); return 0; } diff --git a/test-suite/refcount.cc b/test-suite/refcount.cc index a51c066b53..b948e5edec 100644 --- a/test-suite/refcount.cc +++ b/test-suite/refcount.cc @@ -1,6 +1,6 @@ /* - * $Id: refcount.cc,v 1.3 2003/01/23 00:38:34 robertc Exp $ + * $Id: refcount.cc,v 1.4 2003/08/04 22:14:58 robertc Exp $ * * DEBUG: section xx Refcount allocator * AUTHOR: Robert Collins @@ -36,14 +36,24 @@ #include "squid.h" #include "RefCount.h" -class _ToRefCount :public RefCountable { +class _ToRefCount :public RefCountable +{ + public: _ToRefCount () {++Instances;} + ~_ToRefCount() {--Instances;} - int someMethod() {if (!this) exit(1); - return 1;} - void deleteSelf() const {delete this;} + + int someMethod() + { + if (!this) + exit(1); + + return 1; + } + static int Instances; + private: }; @@ -52,83 +62,93 @@ typedef RefCount<_ToRefCount> ToRefCount; /* Must be zero at the end for the test to pass. */ int _ToRefCount::Instances = 0; -class AlsoRefCountable : public RefCountable, public _ToRefCount { - public: +class AlsoRefCountable : public RefCountable, public _ToRefCount +{ + +public: typedef RefCount Pointer; - int doSomething() { if (!this) exit (1); return 1;} + + int doSomething() { if (!this) + exit (1); return 1;} }; int main (int argc, char **argv) { { - ToRefCount anObject(new _ToRefCount); - anObject->someMethod(); - anObject = anObject; - ToRefCount objectTwo (anObject); - anObject = objectTwo; - { - ToRefCount anotherObject(new _ToRefCount); - anObject = anotherObject; - } - { - ToRefCount aForthObject (anObject); - anObject = ToRefCount(NULL); - aForthObject->someMethod(); - aForthObject = NULL; - } + ToRefCount anObject(new _ToRefCount); + anObject->someMethod(); + anObject = anObject; + ToRefCount objectTwo (anObject); + anObject = objectTwo; + { + ToRefCount anotherObject(new _ToRefCount); + anObject = anotherObject; + } + + { + ToRefCount aForthObject (anObject); + anObject = ToRefCount(NULL); + aForthObject->someMethod(); + aForthObject = NULL; + } } + /* Test creating an object, using it , and then making available as a * refcounted one: */ { - _ToRefCount *aPointer = new _ToRefCount; - aPointer->someMethod(); - ToRefCount anObject(aPointer); + _ToRefCount *aPointer = new _ToRefCount; + aPointer->someMethod(); + ToRefCount anObject(aPointer); } /* standalone pointers should be usable */ { - ToRefCount anObject; + ToRefCount anObject; } /* Can we check pointers for equality */ { - ToRefCount anObject; - ToRefCount anotherObject(new _ToRefCount); - if (anObject == anotherObject) - exit (1); - anotherObject = NULL; - if (!(anObject == anotherObject)) - exit (1); + ToRefCount anObject; + ToRefCount anotherObject(new _ToRefCount); + + if (anObject == anotherObject) + exit (1); + + anotherObject = NULL; + + if (!(anObject == anotherObject)) + exit (1); } /* Can we get the pointer for a const object */ { - ToRefCount anObject (new _ToRefCount); - ToRefCount const aConstObject (anObject); - _ToRefCount const *aPointer = aConstObject.getRaw(); - if (aPointer != anObject.getRaw()) - exit (2); + ToRefCount anObject (new _ToRefCount); + ToRefCount const aConstObject (anObject); + _ToRefCount const *aPointer = aConstObject.getRaw(); + + if (aPointer != anObject.getRaw()) + exit (2); } /* Can we get a refcounted pointer from a const object */ { - _ToRefCount const * aPointer = new _ToRefCount; - ToRefCount anObject (aPointer); + _ToRefCount const * aPointer = new _ToRefCount; + ToRefCount anObject (aPointer); } /* Can we get a pointer to nonconst from a nonconst refcounter */ { - ToRefCount anObject (new _ToRefCount); - _ToRefCount *aPointer = anObject.getRaw(); - aPointer = NULL; + ToRefCount anObject (new _ToRefCount); + _ToRefCount *aPointer = anObject.getRaw(); + aPointer = NULL; } /* Create a doubley inheriting refcount instance, * cast to a single inheritance instance, * then hope :} */ { - ToRefCount aBaseObject; - { - AlsoRefCountable::Pointer anObject (new AlsoRefCountable); - aBaseObject = anObject.getRaw(); - } + ToRefCount aBaseObject; + { + AlsoRefCountable::Pointer anObject (new AlsoRefCountable); + aBaseObject = anObject.getRaw(); + } } return _ToRefCount::Instances == 0 ? 0 : 1; }