On Wed, 18 Nov 2015 22:10:05 -0500, Michael McConville wrote:

> Ted Unangst wrote:
> > Joerg Jung wrote:
> > > > Michael McConville wrote:
> > > > Relayd, httpd, and ntpd define the functions get_data() and
> > > > get_string(). Both call calloc and then immediately memcpy.
> > > > Calloc's zeroing isn't optimized out. These functions are called
> > > > in network data paths in at least a couple places, so all this
> > > > extra writing could have a meaningful performance impact.
> > > 
> > > I think this impact is negligible small and I believe that you can
> > > not even measure it. So this change makes not so much sense to me.
> > 
> > I think there's no reason to be inefficient if the faster way of doing
> > things is just as simple and correct.
> > 
> > > I wonder if using strndup() would make more sense for the first case
> > > here?
> > 
> > Agreed on that point.
> 
> ok?

OK millert@

 - todd

Reply via email to