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

Iain Buclaw <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Iain Buclaw <[email protected]> ---
(In reply to FeepingCreature from comment #0)
> In my post A GC Memory Usage Experiment
> https://forum.dlang.org/post/[email protected] , I
> suggested the existence of a GC leak caused by downsizing data structures.
> This bug report poses a proof-of-concept for such a leak:
> 
> struct S {
>     S[] parent;
> }
> 
> void main() {
>     S parent;
>     while (true) {
>         S[] link = [S(null), parent];
>         link.length = 1;

I assume no zeroing is done here because you might have other slices to the
data.

    auto slice = link[0 .. $];
    link.length = 1;
    assert(slice[1] == parent);

--

Reply via email to