Re: SBuf review

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Fri, 19 Sep 2008 13:08:11 +0800

2008/9/19 Amos Jeffries <squid3_at_treenet.co.nz>:

> I kind of fuzzily disagree, the point of this is to replace MemBuf + String
> with SBuf. Not implement both again independently duplicating stuff.

I'll say it again - ignore MemBuf. Ignore MemBuf for now. Leave it as
a NUL-terminated dynamic buffer with some printf append like
semantics.

When you've implemented a non-NUL-terminated ref-counted memory region
implementation and you layer some basic strings semantics on top of
it, you can slowly convert or eliminate the bulk of the MemBuf users
over.

You're going to find plenty of places where the string handling is
plain old horrible. Don't try to cater for those situations with
things like "NULL strings". I tried that, its ugly. Aim to implement
something which'll cater to something narrow to begin with - like
parsing HTTP headers - and look to -rewrite- larger parts of the code
later on. Don't try to invent things which will somehow seamlessly fit
into the existing code and provide the same semantics. Some of said
semantics is plain shit.

I still don't get why this is again becoming so freakishly complicated.

Adrian
Received on Fri Sep 19 2008 - 05:08:16 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 19 2008 - 12:00:04 MDT