[Asterisk-Dev] [RFC] strncpy -> ast_copy_string

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon May 2 10:44:18 MST 2005


On Monday 02 May 2005 01:05, Kevin P. Fleming wrote:
> Tilghman Lesher wrote:
> > On Sunday 01 May 2005 20:31, Kevin P. Fleming wrote:
> > > I do understand that GCC has a highly-optimized strncpy
> > > implementation for each architecture it runs on, and I don't doubt
> > > that an open-coded version will not be optimized as well. However,
> > > we'd be trading a slightly slower implementation against not
> > > writing many, many billions of excess zero bytes over the lifetime
> > > of an Asterisk instance.
> >
> > Okay, let me get this straight.  You want us to use a function that
> > performs slightly slower than the library implementation and offers
> > no real advantage (other than some belief that it's "more right"). 
> > I'm scratching my head.  Why are we doing this?
>
> Uhh... why are putting words into my mouth here? I guess I wasn't
> explicit enough...

It's interesting that you cut out the quote of what you said, so I've
replaced it for context.  You did originally say that your
implementation was slower, which is why I reacted negatively.  Now
that you've posted benchmarks (and have actually said what you
meant to say the first time), I can see that there's a real improvement
in speed, and so I remove my objection.

-- 
Tilghman



More information about the asterisk-dev mailing list