[Issue 14134] New: Free of large array does not work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 6 08:27:15 PST 2015


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

          Issue ID: 14134
           Summary: Free of large array does not work
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: schveiguy at yahoo.com

If I use GC.free on a large array of data, it is not freed.

example:

auto x = new int[10000];
GC.free(x.ptr);
assert(GC.addrOf(x.ptr) == null); // fails

The last line works in 2.066.1

If I use delete on that array, and it's an array of structs, it will call the
dtor twice on that array.

Note that x.ptr is an interior pointer because of the array padding. I'm not
sure if the old GC took this into account or what, but it seems to work.

--


More information about the Digitalmars-d-bugs mailing list