Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F5920408
test.c
dougm (Doug Moore)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
dougm
Dec 3 2019, 3:23 AM
2019-12-03 03:23:31 (UTC+0)
Size
522 B
Referenced Files
None
Subscribers
None
test.c
View Options
#include
<stdlib.h>
#include
<string.h>
#include
<sys/param.h>
#ifdef DM
#include
"dm.bitstring.h"
#else
#include
"bsd.bitstring.h"
#endif
#include
<stdio.h>
#include
<assert.h>
int
main
()
{
const
int
nbits
=
72000
;
bitstr_t
bit_decl
(
bitstr
,
nbits
);
int
i
,
location
;
memset
(
bitstr
,
0x55
,
bitstr_size
(
nbits
));
for
(
i
=
0
;
i
<
10000
;
++
i
)
{
bit_set
(
bitstr
,
nbits
-1
);
location
=
0
;
bit_ffs_area
(
bitstr
,
nbits
,
2
,
&
location
);
assert
(
nbits
-2
==
location
);
}
printf
(
"location = %d
\n
"
,
location
);
return
0
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2443169
Default Alt Text
test.c (522 B)
Attached To
Mode
D22523: Avoid finding every bit transition in bit_ffs_area_at
Attached
Detach File
Event Timeline
Log In to Comment