Best properly way to destroy a 2 dimensional array?

Alex Parrill via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 6 18:26:00 PDT 2016


On Wednesday, 6 April 2016 at 23:14:10 UTC, Jonathan Villa wrote:
> On Wednesday, 6 April 2016 at 21:33:14 UTC, Alex Parrill wrote:
>
> My general idea is first to get the predicted quantity of 
> combinations

Seems like you already know; your OP says you have 2^n 
combinations.

> so I can divide and parallelize them.

std.parallelism.parallel can do this for you, and works on ranges.

http://dlang.org/phobos/std_parallelism.html#.parallel

> What do you think can be the problem with the lack of 
> deallocation?

Don't know exactly. destroy just runs the destructors, it doesn't 
free any memory. Since the arrays are still in scope, it might 
not be able to free them.


More information about the Digitalmars-d-learn mailing list