This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Account for alloca use when collecting interface addresses
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 24 Mar 2014 17:57:11 +0100
- Subject: Re: [PATCH] Account for alloca use when collecting interface addresses
- Authentication-results: sourceware.org; auth=none
- References: <mvm61n3puag dot fsf at hawking dot suse dot de>
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.