guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Improved string writing


From: Marius Vollmer
Subject: Re: [PATCH] Improved string writing
Date: Mon, 06 Jun 2005 22:30:56 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

>> I like this variant best.  I don't think that writing strings with
>> lots of escape sequences to an unbuffered port happens often enough to
>> justify implementing a second buffering mechanism.
>>
>> When outputting an escaped char, we can additionally assemble the
>> escape sequence in a fixed size buffer and then output that in one go.
>
> I think you overlooked my patch.  :-)

No, I saw it. :) 

> It also assumes that outputting escaped characters is pretty rare.
> Therefore, it only relies on a fixed-size buffer (whose size is that of
> the string plus a few bytes).  This buffer gets filled in in _one_
> string traversal if there are no (or not a lot of) escaped characters.

Yes, but you still need to check for overflow etc.  Your
PUSH_TO_BUFFER macro is not really trivial and it used in six places
or so.  In my view, that's a full buffering mechanism...

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

[Prev in Thread] Current Thread [Next in Thread]