Skip to content

feat: implement roaring64_bitmap_overwrite#789

Merged
lemire merged 1 commit intoRoaringBitmap:masterfrom
Dr-Emann:push-uyzqnwkzvvuw
Mar 3, 2026
Merged

feat: implement roaring64_bitmap_overwrite#789
lemire merged 1 commit intoRoaringBitmap:masterfrom
Dr-Emann:push-uyzqnwkzvvuw

Conversation

@Dr-Emann
Copy link
Member

@Dr-Emann Dr-Emann commented Mar 3, 2026

See #549

Comment on lines +58 to +59
* It might be preferable and simpler to call roaring64_bitmap_copy except
* that roaring64_bitmap_overwrite can save on memory allocations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we actually saving on allocations? It seems like we redo everything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's really just the malloc'd roaring64_bitmap_t itself that's being re-used so far.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is needed tbh, I can't think of a scenario where this would matter a lot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added re-using the memory for the list of containers as well.

I do think it's not very useful, but it'd be nice to have parity with the 32 bit bitmaps. Theoretically, it could be optimized to be smarter in terms of re-using the ART allocations too.

@Dr-Emann Dr-Emann force-pushed the push-uyzqnwkzvvuw branch from 3477202 to 5caf468 Compare March 3, 2026 19:54
@lemire lemire merged commit dd2b614 into RoaringBitmap:master Mar 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants