summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-01 20:26:11 +0000
committered <ed@FreeBSD.org>2012-01-01 20:26:11 +0000
commita201da71788983b3f0445aa46bca32751fc7393c (patch)
treeaf6bd36dd5b255501e8018e450b5f00a332c52cb /sys/conf
parent4a643207b240e975c07808e969d7545d1d8c0b31 (diff)
downloadFreeBSD-src-a201da71788983b3f0445aa46bca32751fc7393c.zip
FreeBSD-src-a201da71788983b3f0445aa46bca32751fc7393c.tar.gz
Introducing memcchr(3).
It seems two of the file system drivers we have in the tree, namely ufs and ext3, use a function called `skpc()'. The meaning of this function does not seem to be documented in FreeBSD, but it turns out one needs to be a VAX programmer to understand what it does. SPKC is an instruction on the VAX that does the opposite of memchr(). It searches for the non-equal character. Add a new function called memcchr() to the tree that has the following advantages over skpc(): - It has a name that makes more sense than skpc(). Just like strcspn() matches the complement of strspn(), memcchr() is the complement of memchr(). - It is faster than skpc(). Similar to our strlen() in libc, it compares entire words, instead of single bytes. It seems that for this routine this yields a sixfold performance increase on amd64. - It has a man page.
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/files1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 2f8b5f6..871921c 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2557,6 +2557,7 @@ libkern/inet_ntoa.c standard
libkern/inet_ntop.c standard
libkern/inet_pton.c standard
libkern/mcount.c optional profiling-routine
+libkern/memcchr.c standard
libkern/memcmp.c standard
libkern/qsort.c standard
libkern/qsort_r.c standard
OpenPOWER on IntegriCloud