Memory allocation faile on string concat

Xie xiemargl at gmail.com
Wed Nov 10 08:33:45 PST 2010


Can't run a simple program. What's wrong, GC?

import std.stdio;
import std.date;

void f0()
{
	wstring a[];

	foreach(i; 0 .. 100_000_000)
	{
  		a ~= " "w;
  	}
}

void main()
{
	auto r = benchmark!(f0)(1);
	writeln(r, "ms");
}

DMD 2.047


More information about the Digitalmars-d-learn mailing list