Using closure causes GC allocation

vino.b via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 2 11:08:19 PDT 2017


On Saturday, 2 September 2017 at 18:02:06 UTC, Moritz Maxeiner 
wrote:
> On Saturday, 2 September 2017 at 17:43:08 UTC, Vino.B wrote:
>> [...]
>
> Line 25 happens because of `[a.name]`. You request a new array: 
> the memory for this has to be allocated (the reason why the 
> compiler says "may" is because sometimes, e.g. if the array 
> literal itself contains only literals, the allocations needn't 
> happen at runtime and no GC call is necessary). Since you don't 
> actually use the array, get rid of it:
>
> [...]

Hi,

   Thank you for your help and the DMD version that i am using is 
DMD 2.076.0 and yes I am on windows.

From,
Vino.B


More information about the Digitalmars-d-learn mailing list