clone all containers which have needCopyOnWrite set to true This can be used to make sure it is safe to munmap a []byte that the roaring array may still have a reference to.
()
| 291 | // This can be used to make sure it is safe to munmap a []byte |
| 292 | // that the roaring array may still have a reference to. |
| 293 | func (ra *roaringArray) cloneCopyOnWriteContainers() { |
| 294 | for i, needCopyOnWrite := range ra.needCopyOnWrite { |
| 295 | if needCopyOnWrite { |
| 296 | ra.containers[i] = ra.containers[i].clone() |
| 297 | ra.needCopyOnWrite[i] = false |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | // unused function: |
| 303 | //func (ra *roaringArray) containsKey(x uint16) bool { |
no test coverage detected