This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Account for alloca use when collecting interface addresses


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]