www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13558] New: GC.free does not work for array pointers of


          Issue ID: 13558
           Summary: GC.free does not work for array pointers of larger
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: public dicebot.lv

Original NG topic :
http://forum.dlang.org/post/uankmwjejsitmlmrbufe forum.dlang.org

This code does not actually free anything:

void main()
    ubyte[] result;
    result.length = 4096;

This happens because for larger size blocks capacity is stored in the beginning
of the memory block making actual `array.ptr` interior pointer. Interior
pointers are ignored by GC.free

There are several possible ways for fixing this that are being considered right

Sep 30 2014