Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147716682
D6848.id17600.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6848.id17600.diff
View Options
Index: include/bitstring.h
===================================================================
--- include/bitstring.h
+++ include/bitstring.h
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <strings.h>
+#include <sys/param.h>
#include <sys/bitstring.h>
#endif /* _BITSTRING_H_ */
Index: sys/sys/bitstring.h
===================================================================
--- sys/sys/bitstring.h
+++ sys/sys/bitstring.h
@@ -65,6 +65,7 @@
#ifdef _KERNEL
#include <sys/libkern.h>
#include <sys/malloc.h>
+#include <sys/param.h>
#endif
#include <sys/types.h>
@@ -105,8 +106,7 @@
/*----------------------------- Public Interface -----------------------------*/
/* Number of bytes consumed by a bit string of nbits bits */
-#define bitstr_size(_nbits) \
- (((_nbits) + _BITSTR_BITS - 1) / 8)
+#define bitstr_size(_nbits) (roundup2((_nbits), 8))
/* Allocate a bit string initialized with no bits set. */
#ifdef _KERNEL
@@ -125,7 +125,7 @@
/* Allocate a bit string on the stack with no bits set. */
#define bit_decl(name, nbits) \
- ((name)[bitstr_size(nbits) / sizeof(bitstr_t)])
+ ((name)[roundup2(bitstr_size(nbits), sizeof(bitstr_t))])
/* Is bit N of bit string set? */
static inline int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 14, 4:16 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29651223
Default Alt Text
D6848.id17600.diff (1 KB)
Attached To
Mode
D6848: Fix bitstring allocation on 32-bit platforms
Attached
Detach File
Event Timeline
Log In to Comment