Lines Matching refs:set
24 void atomicBitsetInit(struct AtomicBitset *set, uint32_t numBits) in atomicBitsetInit() argument
26 set->numBits = numBits; in atomicBitsetInit()
27 memset(set->words, 0, (numBits + 31) / 8); in atomicBitsetInit()
29 set->words[numBits / 32] = ((uint32_t)((int32_t)-1LL)) << (numBits & 31); in atomicBitsetInit()
32 uint32_t atomicBitsetGetNumBits(const struct AtomicBitset *set) in atomicBitsetGetNumBits() argument
34 return set->numBits; in atomicBitsetGetNumBits()
37 bool atomicBitsetGetBit(const struct AtomicBitset *set, uint32_t num) in atomicBitsetGetBit() argument
39 if (num >= set->numBits) /* any value is as good as the next */ in atomicBitsetGetBit()
42 return !!((set->words[num / 32]) & (1UL << (num & 31))); in atomicBitsetGetBit()
45 void atomicBitsetClearBit(struct AtomicBitset *set, uint32_t num) in atomicBitsetClearBit() argument
48 uint32_t *wordPtr = set->words + idx; in atomicBitsetClearBit()
51 if (num >= set->numBits) in atomicBitsetClearBit()
61 int32_t atomicBitsetFindClearAndSet(struct AtomicBitset *set) in atomicBitsetFindClearAndSet() argument
63 uint32_t pos, i, numWords = (set->numBits + 31) / 32; in atomicBitsetFindClearAndSet()
64 uint32_t *wordPtr = set->words; in atomicBitsetFindClearAndSet()