From: Eduard Bagdasaryan Date: Sat, 4 Mar 2023 18:09:05 +0000 (+0000) Subject: Removed unused mem_hdr methods (#1298) X-Git-Tag: SQUID_7_0_1~466 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12984dca09bc50d2309330d015d212b22e763e57;p=thirdparty%2Fsquid.git Removed unused mem_hdr methods (#1298) Unused probably since 2003 commit 528b2c6. --- diff --git a/src/stmem.cc b/src/stmem.cc index 146cf95656..33ef855548 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -100,13 +100,6 @@ mem_hdr::freeDataUpto(int64_t target_offset) return lowestOffset (); } -int -mem_hdr::appendToNode(mem_node *aNode, const char *data, int maxLength) -{ - size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length,maxLength, data); - return result; -} - size_t mem_hdr::writeAvailable(mem_node *aNode, int64_t location, size_t amount, char const *source) { @@ -139,35 +132,6 @@ mem_hdr::appendNode (mem_node *aNode) nodes.insert (aNode, NodeCompare); } -void -mem_hdr::makeAppendSpace() -{ - if (!nodes.size()) { - appendNode (new mem_node (0)); - return; - } - - if (!nodes.finish()->data->space()) - appendNode (new mem_node (endOffset())); - - assert (nodes.finish()->data->space()); -} - -void -mem_hdr::internalAppend(const char *data, int len) -{ - debugs(19, 6, "memInternalAppend: " << this << " len " << len); - - while (len > 0) { - makeAppendSpace(); - int copied = appendToNode (nodes.finish()->data, data, len); - assert (copied); - - len -= copied; - data += copied; - } -} - /* returns a mem_node that contains location.. * If no node contains the start, it returns NULL. */ @@ -406,17 +370,6 @@ mem_hdr::size() const return nodes.size(); } -mem_node const * -mem_hdr::start() const -{ - const SplayNode * result = nodes.start(); - - if (result) - return result->data; - - return nullptr; -} - const Splay & mem_hdr::getNodes() const { diff --git a/src/stmem.h b/src/stmem.h index d5e82d18df..1ca5495c8a 100644 --- a/src/stmem.h +++ b/src/stmem.h @@ -32,8 +32,6 @@ public: bool write (StoreIOBuffer const &); void dump() const; size_t size() const; - /* Not an iterator - thus the start, not begin() */ - mem_node const *start() const; mem_node *getBlockContainingLocation (int64_t location) const; /* access the contained nodes - easier than punning * as a container ourselves @@ -41,16 +39,11 @@ public: const Splay &getNodes() const; char * NodeGet(mem_node * aNode); - /* Only for use of MemObject */ - void internalAppend(const char *data, int len); - static Splay::SPLAYCMP NodeCompare; private: void debugDump() const; bool unlink(mem_node *aNode); - void makeAppendSpace(); - int appendToNode(mem_node *aNode, const char *data, int maxLength); void appendNode (mem_node *aNode); size_t copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *target) const; bool unionNotEmpty (StoreIOBuffer const &);