From: Amos Jeffries Date: Thu, 27 Jun 2013 15:58:46 +0000 (-0600) Subject: Cleanup: update several CBDATA classes part 2 X-Git-Tag: SQUID_3_4_0_1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f49c09b280d40dc4a26cf6e709e392cf34dc0f94;p=thirdparty%2Fsquid.git Cleanup: update several CBDATA classes part 2 Removes several cbdataAlloc/cbdataFree by updating classes to use CBDATA_CLASS2 macro.. --- diff --git a/src/ClientRequestContext.h b/src/ClientRequestContext.h index 5c98f6f271..3d3c0eb867 100644 --- a/src/ClientRequestContext.h +++ b/src/ClientRequestContext.h @@ -20,9 +20,6 @@ class ClientRequestContext : public RefCountable { public: - void *operator new(size_t); - void operator delete(void *); - ClientRequestContext(ClientHttpRequest *); ~ClientRequestContext(); @@ -87,7 +84,7 @@ public: bool readNextRequest; ///< whether Squid should read after error handling private: - CBDATA_CLASS(ClientRequestContext); + CBDATA_CLASS2(ClientRequestContext); }; #endif /* SQUID_CLIENTREQUESTCONTEXT_H */ diff --git a/src/DiskIO/AIO/AIODiskFile.cc b/src/DiskIO/AIO/AIODiskFile.cc index fe49b6c979..7a4b9df4ab 100644 --- a/src/DiskIO/AIO/AIODiskFile.cc +++ b/src/DiskIO/AIO/AIODiskFile.cc @@ -58,18 +58,6 @@ #endif CBDATA_CLASS_INIT(AIODiskFile); -void * -AIODiskFile::operator new(size_t unused) -{ - CBDATA_INIT_TYPE(AIODiskFile); - return cbdataAlloc(AIODiskFile); -} - -void -AIODiskFile::operator delete(void *address) -{ - cbdataFree(address); -} AIODiskFile::AIODiskFile(char const *aPath, AIODiskIOStrategy *aStrategy) : fd(-1), closed(true), error_(false) { diff --git a/src/DiskIO/AIO/AIODiskFile.h b/src/DiskIO/AIO/AIODiskFile.h index fe5ab9b546..15e052c177 100644 --- a/src/DiskIO/AIO/AIODiskFile.h +++ b/src/DiskIO/AIO/AIODiskFile.h @@ -46,8 +46,6 @@ class AIODiskFile : public DiskFile public: friend class AIODiskIOStrategy; - void * operator new (size_t); - void operator delete (void *); AIODiskFile (char const *path, AIODiskIOStrategy *); ~AIODiskFile(); @@ -77,7 +75,7 @@ private: RefCount ioRequestor; bool closed; bool error_; - CBDATA_CLASS(AIODiskFile); + CBDATA_CLASS2(AIODiskFile); }; #endif /* USE_DISKIO_AIO */ diff --git a/src/DiskIO/Blocking/BlockingFile.cc b/src/DiskIO/Blocking/BlockingFile.cc index fcc29ff1a8..d44dde48f1 100644 --- a/src/DiskIO/Blocking/BlockingFile.cc +++ b/src/DiskIO/Blocking/BlockingFile.cc @@ -43,24 +43,8 @@ #if HAVE_ERRNO_H #include #endif -CBDATA_CLASS_INIT(BlockingFile); - -void * -BlockingFile::operator new(size_t sz) -{ - CBDATA_INIT_TYPE(BlockingFile); - BlockingFile *result = cbdataAlloc(BlockingFile); - /* Mark result as being owned - we want the refcounter to do the delete - * call */ - return result; -} -void -BlockingFile::operator delete(void *address) -{ - BlockingFile *t = static_cast(address); - cbdataFree(t); -} +CBDATA_CLASS_INIT(BlockingFile); BlockingFile::BlockingFile(char const *aPath) : fd (-1), closed (true), error_(false) { diff --git a/src/DiskIO/Blocking/BlockingFile.h b/src/DiskIO/Blocking/BlockingFile.h index 59213788b9..7ad857b9c6 100644 --- a/src/DiskIO/Blocking/BlockingFile.h +++ b/src/DiskIO/Blocking/BlockingFile.h @@ -42,8 +42,6 @@ class BlockingFile : public DiskFile { public: - void *operator new(size_t); - void operator delete(void *); BlockingFile(char const *path); ~BlockingFile(); virtual void open(int flags, mode_t mode, RefCount callback); @@ -72,7 +70,7 @@ private: void readDone(int fd, const char *buf, int len, int errflag); void writeDone(int fd, int errflag, size_t len); - CBDATA_CLASS(BlockingFile); + CBDATA_CLASS2(BlockingFile); }; #endif /* SQUID_BLOCKINGFILE_H */ diff --git a/src/DiskIO/DiskDaemon/DiskdFile.cc b/src/DiskIO/DiskDaemon/DiskdFile.cc index 1a99248202..4120b37e98 100644 --- a/src/DiskIO/DiskDaemon/DiskdFile.cc +++ b/src/DiskIO/DiskDaemon/DiskdFile.cc @@ -53,25 +53,6 @@ CBDATA_CLASS_INIT(DiskdFile); -void * -DiskdFile::operator new(size_t unused) -{ - CBDATA_INIT_TYPE(DiskdFile); - DiskdFile *result = cbdataAlloc(DiskdFile); - /* Mark result as being owned - we want the refcounter to do the delete - * call */ - debugs(79, 3, "diskdFile with base " << result << " allocating"); - return result; -} - -void -DiskdFile::operator delete(void *address) -{ - DiskdFile *t = static_cast(address); - debugs(79, 3, "diskdFile with base " << t << " deleting"); - cbdataFree(t); -} - DiskdFile::DiskdFile(char const *aPath, DiskdIOStrategy *anIO) : errorOccured(false), IO(anIO), diff --git a/src/DiskIO/DiskDaemon/DiskdFile.h b/src/DiskIO/DiskDaemon/DiskdFile.h index e30374f1c0..a3a3d0b9c8 100644 --- a/src/DiskIO/DiskDaemon/DiskdFile.h +++ b/src/DiskIO/DiskDaemon/DiskdFile.h @@ -48,8 +48,6 @@ class DiskdFile : public DiskFile { public: - void * operator new(size_t); - void operator delete(void *); DiskdFile(char const *path, DiskdIOStrategy *); ~DiskdFile(); virtual void open(int flags, mode_t aMode, RefCount callback); @@ -84,7 +82,7 @@ private: void ioCompleted(); size_t inProgressIOs; - CBDATA_CLASS(DiskdFile); + CBDATA_CLASS2(DiskdFile); }; #endif diff --git a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc index 95bc9569fe..dca3930850 100644 --- a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc +++ b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc @@ -50,26 +50,6 @@ /* === PUBLIC =========================================================== */ CBDATA_CLASS_INIT(DiskThreadsDiskFile); -void * -DiskThreadsDiskFile::operator new (size_t) -{ - CBDATA_INIT_TYPE(DiskThreadsDiskFile); - DiskThreadsDiskFile *result = cbdataAlloc(DiskThreadsDiskFile); - /* - * We used to call squidaio_init() here, but if the first transaction - * is to unlink a file (e.g., if Squid starts up over the disk space - * limit) then "squidaio" won't be initialized yet. - */ - - return result; -} - -void -DiskThreadsDiskFile::operator delete(void *address) -{ - DiskThreadsDiskFile *t = static_cast(address); - cbdataFree(t); -} DiskThreadsDiskFile::DiskThreadsDiskFile(char const *aPath, DiskThreadsIOStrategy *anIO):fd(-1), errorOccured (false), IO(anIO), inProgressIOs (0) diff --git a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h index 5b94023100..01b86ca672 100644 --- a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h +++ b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.h @@ -41,8 +41,6 @@ class DiskThreadsDiskFile : public DiskFile { public: - void * operator new(size_t); - void operator delete(void *); DiskThreadsDiskFile(char const *path, DiskThreadsIOStrategy *); ~DiskThreadsDiskFile(); virtual void open(int flags, mode_t mode, RefCount callback); @@ -86,7 +84,7 @@ private: void readDone(int fd, const char *buf, int len, int errflag, RefCount request); void writeDone(int fd, int errflag, size_t len, RefCount request); - CBDATA_CLASS(DiskThreadsDiskFile); + CBDATA_CLASS2(DiskThreadsDiskFile); }; #include "DiskIO/ReadRequest.h" diff --git a/src/DiskIO/Mmapped/MmappedFile.cc b/src/DiskIO/Mmapped/MmappedFile.cc index 82a4d68b52..314c934bda 100644 --- a/src/DiskIO/Mmapped/MmappedFile.cc +++ b/src/DiskIO/Mmapped/MmappedFile.cc @@ -49,23 +49,6 @@ private: void *buf; ///< buffer returned by mmap, needed for munmap }; -void * -MmappedFile::operator new(size_t sz) -{ - CBDATA_INIT_TYPE(MmappedFile); - MmappedFile *result = cbdataAlloc(MmappedFile); - /* Mark result as being owned - we want the refcounter to do the delete - * call */ - return result; -} - -void -MmappedFile::operator delete(void *address) -{ - MmappedFile *t = static_cast(address); - cbdataFree(t); -} - MmappedFile::MmappedFile(char const *aPath): fd(-1), minOffset(0), maxOffset(-1), error_(false) { diff --git a/src/DiskIO/Mmapped/MmappedFile.h b/src/DiskIO/Mmapped/MmappedFile.h index 128ea3c6df..c15871e086 100644 --- a/src/DiskIO/Mmapped/MmappedFile.h +++ b/src/DiskIO/Mmapped/MmappedFile.h @@ -9,8 +9,6 @@ class MmappedFile : public DiskFile { public: - void *operator new(size_t); - void operator delete(void *); MmappedFile(char const *path); ~MmappedFile(); virtual void open(int flags, mode_t mode, RefCount callback); @@ -40,7 +38,7 @@ private: void doClose(); - CBDATA_CLASS(MmappedFile); + CBDATA_CLASS2(MmappedFile); }; #endif /* SQUID_MMAPPEDFILE_H */ diff --git a/src/ExternalACLEntry.cc b/src/ExternalACLEntry.cc index 789b06eeec..9925320cde 100644 --- a/src/ExternalACLEntry.cc +++ b/src/ExternalACLEntry.cc @@ -49,21 +49,6 @@ CBDATA_CLASS_INIT(ExternalACLEntry); -void * -ExternalACLEntry::operator new (size_t byteCount) -{ - /* derived classes with different sizes must implement their own new */ - assert (byteCount == sizeof (ExternalACLEntry)); - CBDATA_INIT_TYPE(ExternalACLEntry); - return cbdataAlloc(ExternalACLEntry); -} - -void -ExternalACLEntry::operator delete (void *address) -{ - cbdataFree (address); -} - ExternalACLEntry::ExternalACLEntry() { lru.next = lru.prev = NULL; diff --git a/src/ExternalACLEntry.h b/src/ExternalACLEntry.h index b26d094fa4..47d7138110 100644 --- a/src/ExternalACLEntry.h +++ b/src/ExternalACLEntry.h @@ -81,9 +81,6 @@ class ExternalACLEntry: public hash_link { public: - void *operator new (size_t bytesToAllocate); - void operator delete (void *address); - ExternalACLEntry(); ~ExternalACLEntry(); @@ -101,7 +98,7 @@ public: external_acl *def; private: - CBDATA_CLASS(ExternalACLEntry); + CBDATA_CLASS2(ExternalACLEntry); }; typedef class ExternalACLEntry external_acl_entry; diff --git a/src/PeerDigest.h b/src/PeerDigest.h index 189a861583..5823685a5c 100644 --- a/src/PeerDigest.h +++ b/src/PeerDigest.h @@ -95,9 +95,6 @@ class PeerDigest { public: - void *operator new (size_t); - void operator delete(void *); - CachePeer *peer; /**< pointer back to peer structure, argh */ CacheDigest *cd; /**< actual digest structure */ String host; /**< copy of peer->host */ @@ -132,7 +129,7 @@ public: } stats; private: - CBDATA_CLASS(PeerDigest); + CBDATA_CLASS2(PeerDigest); }; extern const Version CacheDigestVer; diff --git a/src/StoreClient.h b/src/StoreClient.h index 9264c6fd74..3b3ef87762 100644 --- a/src/StoreClient.h +++ b/src/StoreClient.h @@ -59,8 +59,6 @@ class store_client { public: - void *operator new (size_t); - void operator delete (void *); store_client(StoreEntry *); ~store_client(); bool memReaderHasLowerOffset(int64_t) const; @@ -122,7 +120,7 @@ public: } _callback; private: - CBDATA_CLASS(store_client); + CBDATA_CLASS2(store_client); }; void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *); diff --git a/src/client_side.cc b/src/client_side.cc index 3d2e653fc4..dbe8031626 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -193,21 +193,6 @@ static void clientListenerConnectionOpened(AnyP::PortCfg *s, const Ipc::FdNoteId CBDATA_CLASS_INIT(ClientSocketContext); -void * -ClientSocketContext::operator new (size_t byteCount) -{ - /* derived classes with different sizes must implement their own new */ - assert (byteCount == sizeof (ClientSocketContext)); - CBDATA_INIT_TYPE(ClientSocketContext); - return cbdataAlloc(ClientSocketContext); -} - -void -ClientSocketContext::operator delete (void *address) -{ - cbdataFree (address); -} - /* Local functions */ /* ClientSocketContext */ static ClientSocketContext *ClientSocketContextNew(const Comm::ConnectionPointer &clientConn, ClientHttpRequest *); diff --git a/src/client_side.h b/src/client_side.h index a10e0b0caf..89ad23fddb 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -83,8 +83,6 @@ class ClientSocketContext : public RefCountable public: typedef RefCount Pointer; - void *operator new(size_t); - void operator delete(void *); ClientSocketContext(); ~ClientSocketContext(); bool startOfOutput() const; @@ -159,7 +157,7 @@ private: bool mayUseConnection_; /* This request may use the connection. Don't read anymore requests for now */ bool connRegistered_; - CBDATA_CLASS(ClientSocketContext); + CBDATA_CLASS2(ClientSocketContext); }; class ConnectionDetail; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index f4758c61c7..297569de6c 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -171,22 +171,6 @@ clientReplyContext::removeClientStoreReference(store_client **scp, ClientHttpReq aHttpRequest->storeEntry(reference); } -void * -clientReplyContext::operator new (size_t byteCount) -{ - /* derived classes with different sizes must implement their own new */ - assert (byteCount == sizeof (clientReplyContext)); - CBDATA_INIT_TYPE(clientReplyContext); - return cbdataAlloc(clientReplyContext); -} - -void -clientReplyContext::operator delete (void *address) -{ - clientReplyContext * tmp = (clientReplyContext *)address; - cbdataFree (tmp); -} - void clientReplyContext::saveState() { diff --git a/src/client_side_reply.h b/src/client_side_reply.h index 18dec5efe7..15a34fe0de 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -44,8 +44,6 @@ class clientReplyContext : public RefCountable, public StoreClient { public: - void *operator new (size_t byteCount); - void operator delete (void *address); static STCB CacheHit; static STCB HandleIMSReply; static STCB SendMoreData; @@ -152,7 +150,7 @@ private: store_client *old_sc; /* ... for entry to be validated */ bool deleting; - CBDATA_CLASS(clientReplyContext); + CBDATA_CLASS2(clientReplyContext); }; #endif /* SQUID_CLIENTSIDEREPLY_H */ diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 0b9d5cfd30..092aa39fe7 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -107,22 +107,6 @@ ErrorState *clientBuildError(err_type, Http::StatusCode, char const *url, Ip::Ad CBDATA_CLASS_INIT(ClientRequestContext); -void * -ClientRequestContext::operator new (size_t size) -{ - assert (size == sizeof(ClientRequestContext)); - CBDATA_INIT_TYPE(ClientRequestContext); - ClientRequestContext *result = cbdataAlloc(ClientRequestContext); - return result; -} - -void -ClientRequestContext::operator delete (void *address) -{ - ClientRequestContext *t = static_cast(address); - cbdataFree(t); -} - /* Local functions */ /* other */ static void clientAccessCheckDoneWrapper(allow_t, void *); @@ -170,22 +154,6 @@ ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : http(cbd CBDATA_CLASS_INIT(ClientHttpRequest); -void * -ClientHttpRequest::operator new (size_t size) -{ - assert (size == sizeof (ClientHttpRequest)); - CBDATA_INIT_TYPE(ClientHttpRequest); - ClientHttpRequest *result = cbdataAlloc(ClientHttpRequest); - return result; -} - -void -ClientHttpRequest::operator delete (void *address) -{ - ClientHttpRequest *t = static_cast(address); - cbdataFree(t); -} - ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) : #if USE_ADAPTATION AsyncJob("ClientHttpRequest"), diff --git a/src/client_side_request.h b/src/client_side_request.h index 106eef46e4..07bd99ee2a 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -58,11 +58,6 @@ class ClientHttpRequest { public: - void *operator new (size_t); - void operator delete (void *); -#if USE_ADAPTATION - void *toCbdata() { return this; } -#endif ClientHttpRequest(ConnStateData *csd); ~ClientHttpRequest(); /* Not implemented - present to prevent synthetic operations */ @@ -196,7 +191,7 @@ private: #endif private: - CBDATA_CLASS(ClientHttpRequest); + CBDATA_CLASS2(ClientHttpRequest); }; /* client http based routines */ diff --git a/src/esi/Context.h b/src/esi/Context.h index 779cfd1059..7f8012dfbd 100644 --- a/src/esi/Context.h +++ b/src/esi/Context.h @@ -48,8 +48,6 @@ class ESIContext : public esiTreeParent, public ESIParserClient public: typedef RefCount Pointer; - void *operator new (size_t byteCount); - void operator delete (void *address); ESIContext() : thisNode(NULL), http(NULL), @@ -181,7 +179,7 @@ private: virtual void parserComment (const char *s); bool processing; - CBDATA_CLASS(ESIContext); + CBDATA_CLASS2(ESIContext); }; #endif /* SQUID_ESICONTEXT_H */ diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 939ee507dc..480453d54f 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -276,22 +276,6 @@ ESIStreamContext::ESIStreamContext() : finished(false), include (NULL), localbuf /* ESIContext */ static ESIContext *ESIContextNew(HttpReply *, clientStreamNode *, ClientHttpRequest *); -void * -ESIContext::operator new(size_t byteCount) -{ - assert (byteCount == sizeof (ESIContext)); - CBDATA_INIT_TYPE(ESIContext); - ESIContext *result = cbdataAlloc(ESIContext); - return result; -} - -void -ESIContext::operator delete (void *address) -{ - ESIContext *t = static_cast(address); - cbdataFree(t); -} - void ESIContext::setError() { diff --git a/src/esi/Include.cc b/src/esi/Include.cc index 2bb907f71f..46d441a1d5 100644 --- a/src/esi/Include.cc +++ b/src/esi/Include.cc @@ -235,22 +235,6 @@ ESIStreamContext::freeResources() include = NULL; } -void * -ESIStreamContext::operator new(size_t byteCount) -{ - assert (byteCount == sizeof (ESIStreamContext)); - CBDATA_INIT_TYPE(ESIStreamContext); - ESIStreamContext *result = cbdataAlloc(ESIStreamContext); - return result; -} - -void -ESIStreamContext::operator delete (void *address) -{ - ESIStreamContext *t = static_cast(address); - cbdataFree(t); -} - ESIStreamContext * ESIStreamContextNew (ESIIncludePtr include) { diff --git a/src/esi/Include.h b/src/esi/Include.h index f85d398764..ad47bc3068 100644 --- a/src/esi/Include.h +++ b/src/esi/Include.h @@ -46,8 +46,6 @@ class ESIStreamContext : public RefCountable public: typedef RefCount Pointer; - void *operator new(size_t); - void operator delete(void *); ESIStreamContext(); ~ESIStreamContext(); void freeResources(); @@ -57,7 +55,7 @@ public: ESISegment::Pointer buffer; private: - CBDATA_CLASS(ESIStreamContext); + CBDATA_CLASS2(ESIStreamContext); }; /* ESIInclude */ diff --git a/src/fs/coss/store_coss.h b/src/fs/coss/store_coss.h index acdb6dbf0b..482cdf9140 100644 --- a/src/fs/coss/store_coss.h +++ b/src/fs/coss/store_coss.h @@ -107,14 +107,12 @@ class CossRead : public ReadRequest { public: - void * operator new (size_t); - void operator delete (void *); CossRead(ReadRequest const &base, StoreIOState::Pointer anSio) : ReadRequest(base) , sio(anSio) {} StoreIOState::Pointer sio; private: - CBDATA_CLASS(CossRead); + CBDATA_CLASS2(CossRead); }; #include "DiskIO/WriteRequest.h" @@ -124,14 +122,12 @@ class CossWrite : public WriteRequest { public: - void * operator new (size_t); - void operator delete (void *); CossWrite(WriteRequest const &base, CossMemBuf *aBuf) : WriteRequest(base) , membuf(aBuf) {} CossMemBuf *membuf; private: - CBDATA_CLASS(CossWrite); + CBDATA_CLASS2(CossWrite); }; #endif diff --git a/src/fs/coss/store_io_coss.cc b/src/fs/coss/store_io_coss.cc index 9135665803..95b8d6ef39 100644 --- a/src/fs/coss/store_io_coss.cc +++ b/src/fs/coss/store_io_coss.cc @@ -396,34 +396,7 @@ CossSwapDir::storeCossFilenoToMembuf(sfileno f) /* === STATIC =========================================================== */ CBDATA_CLASS_INIT(CossRead); -void * -CossRead::operator new (size_t) -{ - CBDATA_INIT_TYPE(CossRead); - CossRead *result = cbdataAlloc(CossRead); - return result; -} - -void -CossRead::operator delete (void *address) -{ - cbdataFree(address); -} - CBDATA_CLASS_INIT(CossWrite); -void * -CossWrite::operator new (size_t) -{ - CBDATA_INIT_TYPE(CossWrite); - CossWrite *result = cbdataAlloc(CossWrite); - return result; -} - -void -CossWrite::operator delete (void *address) -{ - cbdataFree(address); -} void CossState::doCallback(int errflag) diff --git a/src/fs/ufs/UFSStoreState.cc b/src/fs/ufs/UFSStoreState.cc index 74ba8b8800..a6c4708571 100644 --- a/src/fs/ufs/UFSStoreState.cc +++ b/src/fs/ufs/UFSStoreState.cc @@ -45,19 +45,6 @@ CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,UFSStoreState); -void * -Fs::Ufs::UFSStoreState::operator new (size_t) -{ - CBDATA_INIT_TYPE(UFSStoreState); - return cbdataAlloc(UFSStoreState); -} - -void -Fs::Ufs::UFSStoreState::operator delete (void *address) -{ - cbdataFree(address); -} - void Fs::Ufs::UFSStoreState::ioCompletedNotification() { diff --git a/src/fs/ufs/UFSStoreState.h b/src/fs/ufs/UFSStoreState.h index 4be8139702..cd05d8a498 100644 --- a/src/fs/ufs/UFSStoreState.h +++ b/src/fs/ufs/UFSStoreState.h @@ -42,8 +42,6 @@ namespace Ufs class UFSStoreState : public StoreIOState, public IORequestor { public: - void * operator new (size_t); - void operator delete (void *); UFSStoreState(SwapDir * SD, StoreEntry * anEntry, STIOCB * callback_, void *callback_data_); ~UFSStoreState(); virtual void close(int how); @@ -118,7 +116,7 @@ private: void openDone(); void freePending(); void doWrite(); - CBDATA_CLASS(UFSStoreState); + CBDATA_CLASS2(UFSStoreState); }; MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_read); diff --git a/src/peer_digest.cc b/src/peer_digest.cc index ed91f01fed..0d303a99d4 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -121,21 +121,6 @@ peerDigestClean(PeerDigest * pd) CBDATA_CLASS_INIT(PeerDigest); -void * -PeerDigest::operator new (size_t) -{ - CBDATA_INIT_TYPE(PeerDigest); - PeerDigest *result = cbdataAlloc(PeerDigest); - return result; -} - -void -PeerDigest::operator delete (void *address) -{ - PeerDigest *t = static_cast(address); - cbdataFree(t); -} - /* allocate new peer digest, call Init, and lock everything */ PeerDigest * peerDigestCreate(CachePeer * p) diff --git a/src/store_client.cc b/src/store_client.cc index 3c6c4186f1..a5db344763 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -68,21 +68,6 @@ static void CheckQuickAbort(StoreEntry * entry); CBDATA_CLASS_INIT(store_client); -void * -store_client::operator new (size_t) -{ - CBDATA_INIT_TYPE(store_client); - store_client *result = cbdataAlloc(store_client); - return result; -} - -void -store_client::operator delete (void *address) -{ - store_client *t = static_cast(address); - cbdataFree(t); -} - bool store_client::memReaderHasLowerOffset(int64_t anOffset) const { diff --git a/src/tests/stub_client_side.cc b/src/tests/stub_client_side.cc index 1c9e27ba14..77d9ff4692 100644 --- a/src/tests/stub_client_side.cc +++ b/src/tests/stub_client_side.cc @@ -27,7 +27,6 @@ bool ClientSocketContext::multipartRangeRequest() const STUB_RETVAL(false) void ClientSocketContext::registerWithConn() STUB void ClientSocketContext::noteIoError(const int xerrno) STUB void ClientSocketContext::writeControlMsg(HttpControlMsg &msg) STUB -void ClientSocketContext::operator delete(void *address) STUB void ConnStateData::readSomeData() STUB int ConnStateData::getAvailableBufferLength() const STUB_RETVAL(0)