Memory allocation failed in CT

Andrey saasecondbox at yandex.ru
Tue Jul 9 17:48:52 UTC 2019


Hello,
I have got a problem with compile-time calulations.
I have some code generator that should create some long string of 
code during CT and after generation I mixin it. If I run it 
normally - in run time - then there is no error and I get 
expected output - string with size ~ 3.5 MB.
If I run it in CT then I recieve an error:
> core.exception.OutOfMemoryError at core\exception.d(702): Memory 
> allocation failed
> ----------------
> 0x00007FF65A80BE73
> 0x00007FF65A80BE73
> 0x00007FF65A80BB46
> 0x00007FF65A7FBA5C
> 0x00007FF65A8035EC
> 0x00007FF65A804311
> 0x00007FF658BA733E
> 0x00007FF658CC561F
> 0x00007FF658CC0CD8
> 0x00007FF658CB3728
> 0x00007FF658CB3826
> 0x00007FF658CB4762
> 0x00007FF658CB3826
> 0x00007FF658CB3CD0
> E:\Programs\LDC2\bin\ldc2.exe failed with exit code 1.

I don't understand why...
The only operation in my generator is string concatination: 
_result ~= "some code...".


More information about the Digitalmars-d-learn mailing list