Maximal length for :bytes?

Russ Allbery rra at stanford.edu
Fri Sep 5 05:59:02 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

>> I think this would be a good place to use asprintf and dynamically
>> allocated memory rather than a static buffer.

> It is what I did for Lines: whose real value was not taken into account
> for the overview database.  I added a xasprintf call.  But I thought it
> was more optimal to have a global buffer (this buffer for Bytes: is in a
> data structure, the same for a channel) because it is not reallocated
> for each article.  Anyway, the loss in term of performance is
> neglectable.

Yeah, I guess that could be a problem, and we do try to avoid doing memory
allocation for each article.  You could create a persistant buffer for the
Bytes value and use buffer_sprintf.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list