[Issue 19025] New: Better definition of deallocateAll in ContiguousFreeList

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 25 19:52:05 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19025

          Issue ID: 19025
           Summary: Better definition of deallocateAll in
                    ContiguousFreeList
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: mmcomando at gmail.com

Deallocation of all memory in ContiguousFreeList can be done without using
parent.deallocateAll. Buffer used by ContiguousFreeList is always allocated by
parent so deallocateAll it should be enought to implement deallocateAll.

If I understand everything properly such an implementation would be enought:

bool deallocateAll()
{
    bool result = parent.deallocate(support);
    allocated = 0;
    return result;
}


I am not sure but current implementation might be wrong because it is calling
parent.deallocateAll() and parent might have been used to allocate some other
data not only buffer for ContiguousFreeList.

--


More information about the Digitalmars-d-bugs mailing list