[squid-dev] Idea: what if SBuf was a Packable?

Francesco Chemolli gkinkie at gmail.com
Wed Mar 13 09:25:03 UTC 2024


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20240313/345e6ece/attachment.htm>


More information about the squid-dev mailing list