[Diskfilemon-commits] SF.net SVN: diskfilemon:[28] trunk
Status: Alpha
Brought to you by:
steved62
From: <ste...@us...> - 2009-10-05 23:25:12
|
Revision: 28 http://diskfilemon.svn.sourceforge.net/diskfilemon/?rev=28&view=rev Author: steved62 Date: 2009-10-05 23:25:05 +0000 (Mon, 05 Oct 2009) Log Message: ----------- Convert away from using the str* functions in favor of the mem* functions, which are quicker. In most cases we already have the string lengths. In other cases the length is available, for example, sprintf returns the length of the string it created. When we know the string lengths we never need to call strlen(). memcpy is faster than strcpy because it doesn't have to check every byte copied to see if it is the nul terminator. Similarly for memcmp vs. strcmp. Convert some of the internal functions that generate strings to return the length of the string it created. It enables the same efficiencies we can do with functions such as sprintf. Convert to strlcpy instead of strncpy. The kernel's strncpy pads the remainder of the buffer with zeroes, which we don't need. strlcopy stops when it hits the nul terminator. This can be a significant benefit in cases such as writing a short string to a 4KB log buffer. Modified Paths: -------------- trunk/debugfs_control.c trunk/debugfs_stats.c trunk/kprobes.c trunk/log.c trunk/log.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |