Allocating large 2D array in D

Denis Shelomovskij verylonglogin.reg at gmail.com
Thu Feb 7 21:38:36 PST 2013


04.02.2013 19:23, Sparsh Mittal пишет:
> I am allocating 2d array as:
>
> double[gridSize][gridSize] gridInfo;
>
> which works for small dimension, but for large dimension, 16Mb limit comes.
>
> Would you please tell me how do allocate a large 2d array (which has to
> be done as a dynamic array)? It is a square grid and dimensions are
> already known.
>
> I also searched internet but could not find an answer. Thanks.

A common problem. Use unstd.multidimensionalarray to obtain a sliceable 
multidimensional rectangular arrays (currently only implemented for 
dimensions count (not lengths) known at CT):
http://denis-sh.github.com/phobos-additions/unstd.multidimensionalarray.html

-- 
Денис В. Шеломовский
Denis V. Shelomovskij


More information about the Digitalmars-d-learn mailing list