>On Thu, Jan 24 2019 04:22:20 -0700, Theo de Raadt wrote:
>> I would like to know if this does more malloc.  I worry it is an additional
>> level of malloc per line.
>
>It does do more malloc than plain fgetln since fgetln does no copying,
>but nowhere near every line. The same buffer lnbuf is used for each
>line, and libc getline() reallocates it if it is not large enough.

If there is more allocation, it will be more expensive.  Our malloc
has many checks and also fresh allocations trigger expensive code paths
in mmap intentionally -- this makes our runtime somewhat slower, but finds
and fixes bugs in the same software running on other operating systems
who lack our attitude towards rigor over performance).

question is, are you fixing a stylistic nit, or making it fundamentally
better.  A bunch of us run a whole ton of grep during our work...

that's my basic question.


Reply via email to