[Asterisk-Dev] [RFC] strncpy -> ast_copy_string
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Sun May 1 21:35:34 MST 2005
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?
It might be different if it was actually faster, but you've already
tested that and found it not to be the case. Let me remind you that
Asterisk's primary purpose to process calls. Anything that slows
down that processing and decreases the number of calls we're able
to process needs a real good reason. Less work is _only_ a valid
reason if CPU time is decreased. More work or no, the library
implementation is faster, so that's what we need to keep.
--
Tilghman
More information about the asterisk-dev
mailing list