On Tuesday, 2 June 2015 at 19:18:15 UTC, Stiff wrote:
Hi,

I'm reading in a rather large text file (~25Mb) line by line, where I don't need to hang on to a line for more than one iteration through my loop. I'm consistently getting an InvalidMemoryOperationError on my 2,547th iteration, and based on console outputs, I'm fairly certain it's coming from the byLine() method. To be clear, I'm just doing a simple:

foreach (line; file.byLine()){ ... }

Am I possibly screwing something up? I haven't declared any classes or written any destructors. Is this a bug? If so, is there a workaround?

Thanks!

Might be issue 14005/13856 (14005 has the InvalidMemoryOperationError test case).

It's an embarrassing issue that comes up again and again. I really hope a fix makes it through soon.

https://issues.dlang.org/show_bug.cgi?id=14005
https://issues.dlang.org/show_bug.cgi?id=13856

Reply via email to