1
0
Fork 0
forked from External/ergo

tweaks to NAMES implementation

This commit is contained in:
Shivaram Lingamneni 2023-04-02 02:30:14 -04:00
parent 378d88fee2
commit 780116b0c2
6 changed files with 84 additions and 41 deletions

View file

@ -48,6 +48,13 @@ func BitsetSet(set []uint32, position uint, on bool) (changed bool) {
}
}
// BitsetClear clears the bitset in-place.
func BitsetClear(set []uint32) {
for i := 0; i < len(set); i++ {
atomic.StoreUint32(&set[i], 0)
}
}
// BitsetEmpty returns whether the bitset is empty.
// This has false positives under concurrent modification (i.e., it can return true
// even though w.r.t. the sequence of atomic modifications, there was no point at