Skip to content

Bitmap size is limited to 2^32 elements #1

@cym13

Description

@cym13

Bitmap size is limited to 2^32 elements. Adding more elements will cause integer overflow of the length.

Test (quite long to run):

import roaring.roaring;

void main() {
    auto map = new Roaring;
    long limit = (cast(long) uint.max) + 1;

    for (long i; i<limit ; i++)
        map.add(cast(uint)i);

    assert(map.length == 0);
}

This is not directly an issue with the D wrapper but with the underlying C library (see RoaringBitmap/CRoaring#1). I choose however to open an issue nonetheless because that overflow happens without any safeguard or warning and isn't documented anywhere.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions