blob: efdb61d06162cf5fc040e4024edb8680fa9f1d01 (
plain) (
tree)
|
|
#ifndef DEF_BITSET_H
#define DEF_BITSET_H
#include <types.h>
#define INDEX_FROM_BIT(a) (a/(8*4))
#define OFFSET_FROM_BIT(a) (a%(8*4))
struct bitset {
uint32_t *bits;
uint32_t size;
void set(uint32_t num);
void clear(uint32_t num);
uint32_t test(uint32_t num);
uint32_t firstFree();
size_t mem_size() {
return size/8;
}
};
#endif
|