Skip to content

roaring::RoaringBitmap::full().statistics() panics if overflow checks are enabled #357

Description

@masklinn

thread 'main' (3828616) panicked at roaring-0.11.4/src/bitmap/statistics.rs:92:21

This points at

n_values_run_containers += runs.len() as u32;

The cardinality of the bitmap is exactly 232 (across 216 run containers), so it blows up when collecting the last container as it needs to store a value above u32::MAX.

Probably not a big issue, but it was a bit surprising to hit that first thing when trying to compare RoaringBitmap::new() and RoaringBitmap::full().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions