alloca vs malloc

Siddhesh Poyarekar siddhesh@redhat.com
Mon May 19 07:21:00 GMT 2014


On Sat, May 17, 2014 at 12:07:54AM +0000, Joseph S. Myers wrote:
> On Sat, 17 May 2014, Ondrej Bilka wrote:
> 
> > For libc there are better alternatives, I will add priority to malloca
> > cleanup. As glibc code is now alloca are mostly
> > trivial or following this pattern occuring about hundred times:
> 
> I suggest doing such cleanup in a maximally conservative and incremental 
> way:

One straightforward set of changes in this area would be to replace
the alloca+extend_alloca usage in getaddrinfo code with straight
malloc+free.  I doubt if the performance improvement due to using
alloca is in any way noticeable in those functions given that the
major costs there would be file or network I/O.

Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140519/46531ca6/attachment.sig>


More information about the Libc-alpha mailing list