Memory allocation faile on string concat

Xie Xiemargl at gmail.com
Wed Nov 10 11:38:02 PST 2010


Sorry, it a mistypo (i began from wchar[], later changed to wstring)

Real problem can be seen here

import std.stdio;
import std.date;

void f0()
{
	wstring a;

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

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


More information about the Digitalmars-d-learn mailing list