Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



Thomas Klausner wrote:
> From the diffs, I don't think you'll ever notice the difference;
> the changes are not in any "fast" paths whatsoever. And I don't
> think that the speed difference between the two is so big either.
> 
> And I agree with itojun that it's just the safer API to use.

Countrary to this, I agree with Matt. Please don't do wholesale replace
of strcpy() to strlcpy() - it's slower, sometimes very significantly,
since strcpy() is normally implemented in assembler. Furthermore,
gcc can optimize strcpy(), but cannot strlcpy().

Do not do random (and even less wholesale) replace of strcpy()/strcat()
with strl*().

I do think it would be good to migrate from strn*() to
strl*() however.  strl*() API is less prone to programming
mistakes than strn*()

Jaromir
-- 
Jaromir Dolecek <jdolecek%NetBSD.org@localhost>            
http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-



Home | Main Index | Thread Index | Old Index