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.

-- 
Lauri Tirkkonen | lotheac @ IRCnet

Reply via email to