Thread overview | |||||
---|---|---|---|---|---|
|
May 12, 2016 Is it bug compiler? | ||||
---|---|---|---|---|
| ||||
Windows 7 32bit ----------------------- import std.stdio; import std.conv; class CFormaMain { ~this() { char[] zz = [ 'A', 'B', 'C' ]; writeln(to!string(zz)); } } int main(string[] args) { CFormaMain formaMain; formaMain = new CFormaMain(); return 0; } ----------------------- core.exception.InvalidMemoryOperationError@src\core\exception.d(693): Invalid me mory operation |
May 12, 2016 Re: Is it bug compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to MGW | On 5/12/16 9:20 AM, MGW wrote:
> Windows 7 32bit
> -----------------------
> import std.stdio;
> import std.conv;
>
> class CFormaMain {
> ~this() {
> char[] zz = [ 'A', 'B', 'C' ];
This allocates. Allocations are not allowed in GC collection cycle.
-Steve
|
May 12, 2016 Re: Is it bug compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to MGW | On Thursday, 12 May 2016 at 13:20:35 UTC, MGW wrote:
> Windows 7 32bit
> -----------------------
> import std.stdio;
> import std.conv;
>
> class CFormaMain {
> ~this() {
> char[] zz = [ 'A', 'B', 'C' ];
> writeln(to!string(zz));
> }
> }
>
> int main(string[] args) {
> CFormaMain formaMain;
> formaMain = new CFormaMain();
> return 0;
> }
> -----------------------
> core.exception.InvalidMemoryOperationError@src\core\exception.d(693): Invalid me
> mory operation
No. Look at the documentation of InvalidMemoryOperationError.
|
Copyright © 1999-2021 by the D Language Foundation