Skip to content

BitArray class uses wrong memory allocation functions #5652

@quietust

Description

@quietust

DFHack's BitArray<> class is a reimplementation of Toady's flagarrayst with a few additional features. However, it is not strictly compatible with it because it uses realloc() and free() to manage the flag data buffer, while Toady's version uses new unsigned char[] and delete[].

In practice, this "works" on all of our supported platforms, but tools such as valgrind rightfully complain that we're mixing memory management functions incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions