diff options
author | asomers <asomers@FreeBSD.org> | 2016-05-23 20:29:18 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2016-05-23 20:29:18 +0000 |
commit | d14be2b60f06ebf4ccf3da56f630c33392a87b92 (patch) | |
tree | 75b6884b5df8b2102bd857790de587c4b853854d /sys/sys/param.h | |
parent | 50b3af23076e765c9e465ecc41463bd28f983697 (diff) | |
download | FreeBSD-src-d14be2b60f06ebf4ccf3da56f630c33392a87b92.zip FreeBSD-src-d14be2b60f06ebf4ccf3da56f630c33392a87b92.tar.gz |
Add bit_count to the bitstring(3) api
Add a bit_count function, which efficiently counts the number of bits set in
a bitstring.
sys/sys/bitstring.h
tests/sys/sys/bitstring_test.c
share/man/man3/bitstring.3
Add bit_alloc
sys/kern/subr_unit.c
Use bit_count instead of a naive counting loop in check_unrhdr, used
when INVARIANTS are enabled. The userland test runs about 6x faster
in a generic build, or 8.5x faster when built for Nehalem, which has
the POPCNT instruction.
sys/sys/param.h
Bump __FreeBSD_version due to the addition of bit_alloc
UPDATING
Add a note about the ABI incompatibility of the bitstring(3)
changes, as suggested by lidl.
Suggested by: gibbs
Reviewed by: gibbs, ngie
MFC after: 9 days
X-MFC-With: 299090, 300538
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6255
Diffstat (limited to 'sys/sys/param.h')
-rw-r--r-- | sys/sys/param.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h index 665d806..edaab48 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100111 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100112 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, |