[PATCH] Account for alloca use when collecting interface addresses
Ondřej Bílka
neleai@seznam.cz
Mon Mar 24 16:57:00 GMT 2014
On Mon, Mar 24, 2014 at 03:04:23PM +0100, Andreas Schwab wrote:
> # ip li add name dummy0 type dummy
> # site_id=$(head -c6 /dev/urandom | od -tx2 -An | tr ' ' ':')
> # for ((i = 0; i < 65536; i++)) do
> > ip ad ad $(printf fd80$site_id::%04x $i)/128 dev dummy0
> > done
> # (ulimit -s 900; getent ahosts localhost)
> # ip li de dummy0
>
> [BZ #16002]
> * sysdeps/unix/sysv/linux/check_pf.c (make_request): Use
> alloca_account and account alloca use for struct in6ailist.
As far as I recall there was a similar patch that did not get in.
After I reviewed that I noticed that you could drop alloca altogether.
Its only used to construct a single linked list and then copy it to
malloced array. Faster way would be to malloc array directly, realloc as
necessary.
More information about the Libc-alpha
mailing list