Problems with BitMap buffer management

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: None
    • Component/s: hotspot
    • b120
    • generic
    • generic

      BitMap has a trivial copy constructor and assignment operator. As a result, making a copy will just make a new reference to the data buffer.

      This means that all copies of a BitMap share the same data buffer, so modifying one modifies all copies. That seems a surprising result for copying, and might not be what's intended.

      This also causes problems for lifetime management of the data buffer:

      All BitMap constructors specify false for the allocator's free_in_destructor argument. That's fine for a BitMap using resource-based allocation. It also works for a BitMap that was constructed from an externally supplied buffer and didn't have a resizing operation performed. However, it means that other uses of BitMap will leak the buffer.

            Assignee:
            Stefan Karlsson
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: