MCPcopy
hub / github.com/RoaringBitmap/roaring / SetCopyOnWrite

Method SetCopyOnWrite

roaring.go:2170–2172  ·  view source on GitHub ↗

SetCopyOnWrite sets this bitmap to use copy-on-write so that copies are fast and memory conscious if the parameter is true, otherwise we leave the default where hard copies are made (copy-on-write requires extra care in a threaded context). Calling SetCopyOnWrite(true) on a bitmap created with FromB

(val bool)

Source from the content-addressed store, hash-verified

2168// (copy-on-write requires extra care in a threaded context).
2169// Calling SetCopyOnWrite(true) on a bitmap created with FromBuffer is unsafe.
2170func (rb *Bitmap) SetCopyOnWrite(val bool) {
2171 rb.highlowcontainer.copyOnWrite = val
2172}
2173
2174// GetCopyOnWrite gets this bitmap's copy-on-write property
2175func (rb *Bitmap) GetCopyOnWrite() (val bool) {

Callers 15

TestIssue386Function · 0.95
TestCloneOfCOWFunction · 0.95
TestStringerCOWFunction · 0.95
TestFastCardCOWFunction · 0.95
TestIntersects1COWFunction · 0.95
TestRangePanicCOWFunction · 0.95
TestRangeRemovalCOWFunction · 0.95
TestFlipOnEmptyCOWFunction · 0.95
TestBitmapRankCOWFunction · 0.95
TestBitmapSelectCOWFunction · 0.95

Calls

no outgoing calls

Tested by 15

TestIssue386Function · 0.76
TestCloneOfCOWFunction · 0.76
TestStringerCOWFunction · 0.76
TestFastCardCOWFunction · 0.76
TestIntersects1COWFunction · 0.76
TestRangePanicCOWFunction · 0.76
TestRangeRemovalCOWFunction · 0.76
TestFlipOnEmptyCOWFunction · 0.76
TestBitmapRankCOWFunction · 0.76
TestBitmapSelectCOWFunction · 0.76