Re: for now I'll implement using raw access and explicit user-invked COW

From: Amos Jeffries <>
Date: Fri, 26 Dec 2008 17:07:12 +1300

Kinkie wrote:
> On Fri, Dec 19, 2008 at 5:57 PM, Alex Rousskov
> <> wrote:
>> Kinkie,
>> I still think that this plan is much better:
>> (09:27:34 AM) rousskov: Here is an even simpler plan: write String
>> without ever using non-const raw(). Get it reviewed. Optimize as step 2,
>> if needed.
>> In other words, do not use any dangerous, exceptional Buffer interfaces.
>> Pass the non-performance review. Optimize later. Writing correct code
>> using safe/common Buffer interfaces should not be harder than "raw
>> access and explicit user-invked COW". It should be easier!
>> You can use const raw() where needed in String, but it should not be
>> needed often.
>> You should not need any user-invoked COW, ever (if "user-invoked" means
>> "explicitly initiated by user").
> In the end I've ended adding a public cow() call: it's an user-invoked
> optimization which doesn't hurt the semantics, and since I'm not
> designing a general-purpose library I don't want to protect users
> against themselves.
> For the lowerCase() call I ended up not needing it, as I chose to use
> public interfaces (operator[] and setAt()). Not efficient, but
> efficiency can be added at a later stage if needed.
> This said, I consider the framework to be reasonably complete; further
> developments will be added as driven by the needs of the callers.
> While waiting for review of this code by anyone willing to do it, I'll
> concentrate on designing a replacement HTTP parser as an example user.
> I'll try to come up with a blueprint to agree with everyone on the
> general principles before trying to code a prototype.
> Merry Christmas!

I've worked through the new .h and started on the .cc.
All I can see so far are documentation errors in the .cc and typos in
the .h. Patch coming later to fix those.

I've noticed there are whole sections now cut out of the old String
files. I thought that was being left untouched so the migration was not
confused by any missed old semantics on new objects?


Please be using
   Current Stable Squid 2.7.STABLE5 or 3.0.STABLE11
   Current Beta Squid
Received on Fri Dec 26 2008 - 04:07:10 MST

This archive was generated by hypermail 2.2.0 : Fri Dec 26 2008 - 12:00:02 MST