Page MenuHomeFreeBSD
Authored By
dougm
Dec 3 2019, 3:23 AM
Size
522 B
Referenced Files
None
Subscribers
None
#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

Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2443169
Default Alt Text
test.c (522 B)

Event Timeline