Re: cvs commit: squid/src MemBuf.c

From: Alex Rousskov <>
Date: Wed, 17 Apr 2002 09:05:58 -0600 (MDT)

On Tue, Apr 16, 2002, wrote:

> hno 2002/04/15 18:35:39 MDT
> Modified files:
> src MemBuf.c
> Log:
> Have memBufAppend \0 terminate the data, allowing it to be used
> on strings

Original design note:

        memBufAppend should not be used on strings [that
        need implicit \0 termination]. Use memBufPrintf for that.
        memBufAppend is for appending raw opaque data.

I am not objecting to any changes, of course. Just noting the original
intention to have less overhead for raw operations. If appending
single strings is a common operation and typing memBufPrintf("%s",
str) is too much, then replacing memBufAppend with a pair of
memBufAppendBytes and memBufAppendString (or equivalent) may be the
right solution to the problem.

Adding a termination character after appending S raw bytes to a buffer
of size S is expensive and totally unnecessary.

Received on Wed Apr 17 2002 - 09:06:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:11 MST