Idea: what if SBuf was a Packable?

Francesco Chemolli <[email protected]> Wed, 13 Mar 2024 16:25:03 +0700
Newsgroups gmane.comp.web.squid.devel
Message-ID <CA+Y8hcOCcpwV8d-6-ArynVaLGqdFMKapV=9HFybUFtuhiL94-g@mail.gmail.com>
Hi all,
  I spent some time wondering whether we could reduce
code duplication by making SBuf implement the Packable interface,
and replacing SBufStream with PackableStream.

The interface changes seem rather minimal, SBuf already implements
append(const char*, int) and vappendf; the main difference there is
that SBuf returns *this.
These methods are of course virtual, which is a price to pay, but besides
the vtbl size, maybe there is a way to not pay their cost when not used

What do you think?

-- 
    Francesco

_______________________________________________
squid-dev mailing list
[email protected]
https://lists.squid-cache.org/listinfo/squid-dev