Static array size limit

simendsjo simen.endsjo at pandavre.com
Sat Apr 2 06:21:52 PDT 2011


http://digitalmars.com/d/2.0/arrays.html says static arrays are
limited to 16mb, but I can only allocate 1mb.
My fault, or bug?

	enum size = (16 * 1024 * 1024) / int.sizeof;
	//int[size] a;   // Error: index 4194304 overflow for static
array
	enum size2 = (16 * 1000 * 1000) / int.sizeof;
	//int[size2] b; // Stack Overflow
	//int[250_001] c; // Stack Overflow
	int[250_000] d; // ok


More information about the Digitalmars-d-learn mailing list