Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-09 Thread realhet via Digitalmars-d-learn
On Thursday, 8 June 2017 at 17:39:41 UTC, Ivan Kazmenko wrote: Reported: https://issues.dlang.org/show_bug.cgi?id=17481 Thank You!

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Thursday, 8 June 2017 at 15:35:06 UTC, Ivan Kazmenko wrote: Perhaps a regression should be filed, or searched for, at issues.dlang.org. I can do it, but not right now, and would be glad if someone beats me to it. Reported: https://issues.dlang.org/show_bug.cgi?id=17481

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Thursday, 8 June 2017 at 11:41:40 UTC, realhet wrote: I've managed to narrow the problem even more: //win32 dmd -O class Obj{ synchronized void trigger(){ new ubyte[1]; } } void main(){ auto k = new shared Obj; k.trigger; } This time I got a more sophisticated error message:

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread realhet via Digitalmars-d-learn
I've managed to narrow the problem even more: //win32 dmd -O class Obj{ synchronized void trigger(){ new ubyte[1]; } } void main(){ auto k = new shared Obj; k.trigger; } This time I got a more sophisticated error message: object.Error@(0): Access Violation 0x7272456D

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread ketmar via Digitalmars-d-learn
realhet wrote: On Thursday, 8 June 2017 at 10:48:41 UTC, ketmar wrote: worksforme with -O, and with -O -inline. I forgot to mention, that I'm generating win32 output. DMD32 D Compiler v2.074.0 mine: GNU/Linux, 32 bit, dmd git HEAD.

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread realhet via Digitalmars-d-learn
On Thursday, 8 June 2017 at 10:48:41 UTC, ketmar wrote: worksforme with -O, and with -O -inline. I forgot to mention, that I'm generating win32 output. DMD32 D Compiler v2.074.0

Re: DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread ketmar via Digitalmars-d-learn
worksforme with -O, and with -O -inline.

DMD [-O flag] vs. [memory allocation in a synchronized class]

2017-06-08 Thread realhet via Digitalmars-d-learn
Hi, This code works well with the unoptimized compilation with DMD. import std.array; synchronized class Obj{ private int[] arr; void trigger(){ arr.length += 1; } } void main(){ auto k = new shared Obj; k.trigger; } And when I use the -O option, it shows the following error in the