1
0
Fork 0
forked from External/ergo

tweaks to NAMES implementation (#2058)

* tweaks to NAMES implementation

* tweak member caching

* add a benchmark for NAMES
This commit is contained in:
Shivaram Lingamneni 2023-04-13 23:15:56 -07:00 committed by GitHub
parent 378d88fee2
commit eeec481b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 148 additions and 56 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