Something wrong with GC

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 22 08:56:17 PDT 2016


On 20.03.2016 08:49, stunaep wrote:
> The gc throws invalid memory errors if I use Arrays from std.container.
> For example, this throws an InvalidMemoryOperationError:
>> import std.stdio;
>> import std.container;
>>
>> void main() {
>>     new Test();
>> }
>>
>> class Test {
>>
>>     private Array!string test = Array!string();
>>
>>     this() {
>>         test.insert("test");
>>         writeln(test[0]);
>>     }
>> }

I can reproduce the InvalidMemoryOperationError with git head dmd, but 
there doesn't seem to be a problem with 2.070. So I'd say this is a 
regression in the development version.

I've filed an issue: https://issues.dlang.org/show_bug.cgi?id=15821

You're probably building dmd/phobos from git, or you're using a nightly, 
right? Maybe you can go back to 2.070.2 until this is sorted out.


More information about the Digitalmars-d-learn mailing list