[Issue 15481] GC profiler thinks reducing array.length triggers reallocation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 28 05:42:55 PST 2015


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

ag0aep6g at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g at gmail.com
            Summary|Reducing array.length       |GC profiler thinks reducing
                   |triggers reallocation       |array.length triggers
                   |                            |reallocation

--- Comment #1 from ag0aep6g at gmail.com ---
This is a bug in the GC profiler. The array is not relocated. You can check by
comparing the pointers:

----
void main()
{
    int[] arr;
    arr.length = 7;
    int* p = arr.ptr;
    arr.length = 6;
    assert(arr.ptr == p); /* passes */
}
----

I'm changing the title of this issue accordingly.

--


More information about the Digitalmars-d-bugs mailing list