Re: Something wrong with GC

2016-03-23 Thread ag0aep6g via Digitalmars-d-learn
On 22.03.2016 16:56, ag0aep6g wrote: I've filed an issue: https://issues.dlang.org/show_bug.cgi?id=15821 And it's been fixed: https://github.com/D-Programming-Language/druntime/pull/1519 Since the issue was a regression, the fix was made against the stable branch. It's going to be in the

Re: Something wrong with GC

2016-03-23 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 22 March 2016 at 13:46:41 UTC, stunaep wrote: So what am I do to? Just learn more about available containers and their semantics. Maybe you don't need Array!T when there is a simple T[]. If you think you do need Array, then think about memory management: where are you going to

Re: Something wrong with GC

2016-03-22 Thread ag0aep6g via Digitalmars-d-learn
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 =

Re: Something wrong with GC

2016-03-22 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Tuesday, 22 March 2016 at 13:46:41 UTC, stunaep wrote: public class Example2 { private int one; private int two; public this(int one, int two) { this.one = one; this.two = two; } } in a tree map and list of

Re: Something wrong with GC

2016-03-22 Thread stunaep via Digitalmars-d-learn
On Monday, 21 March 2016 at 07:55:39 UTC, thedeemon wrote: On Sunday, 20 March 2016 at 07:49:17 UTC, stunaep wrote: The gc throws invalid memory errors if I use Arrays from std.container. Those arrays are for RAII-style deterministic memory release, they shouldn't be freely mixed with

Re: Something wrong with GC

2016-03-21 Thread tsbockman via Digitalmars-d-learn
On Sunday, 20 March 2016 at 07:49:17 UTC, stunaep wrote: The gc throws invalid memory errors if I use Arrays from std.container. ... Not sure what to do here I don't know what your larger goal is, but maybe std.array.Appender would be a better fit?

Re: Something wrong with GC

2016-03-21 Thread thedeemon via Digitalmars-d-learn
On Sunday, 20 March 2016 at 07:49:17 UTC, stunaep wrote: The gc throws invalid memory errors if I use Arrays from std.container. Those arrays are for RAII-style deterministic memory release, they shouldn't be freely mixed with GC-allocated things. What happens here is while initializing

Something wrong with GC

2016-03-20 Thread stunaep via Digitalmars-d-learn
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();