Commit 8746862
committed
roaring64: honor copy-on-write in Bitmap.Or
When two bitmaps share a container key, the in-place Or was calling
getContainerAtIndex, which returns the raw container without consulting
needCopyOnWrite. If rb's container at that index was shared with another
bitmap (e.g. produced by Clone() on a CoW-enabled bitmap), the Or would
mutate the shared container in place and silently corrupt the other
bitmap.
Switch to getWritableContainerAtIndex, which clones the container first
when needCopyOnWrite is set. This matches what the sibling AndNot/And
methods in the same file already do, and what the 32-bit Bitmap.Or does
via getUnionedWritableContainer.1 parent 6d3d113 commit 8746862
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1768 | 1768 | | |
1769 | 1769 | | |
1770 | 1770 | | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
0 commit comments