In conclusion, stack allocation must be destroyed

ryuukk_ ryuukk.dev at gmail.com
Tue Jul 19 11:54:17 UTC 2022


On Monday, 18 July 2022 at 12:13:47 UTC, FeepingCreature wrote:
> On Thursday, 14 July 2022 at 13:14:59 UTC, ryuukk_ wrote:
>> It is misleading, nobody expect this to be GC allocated
>>
>> It should be equal to:
>>
>> ```D
>> int[3] arr = [1, 2, 3]
>> ```
>>
>> Also why it is GC allocated without requiring ``new``?
>
> DMD 2.099 has introduced crippling bugs that arise from 
> overzealous stack allocation. If I could have a command line 
> switch that would always heap allocate everything not 
> *completely obviously* a stack allocation, ie. always heap 
> allocate closures, always heap allocate arrays, I would put it 
> in our build scripts and never touch it again.
>
> Stack allocation without extremely reliable escape analysis is 
> an express ride to corruptiontown. And D does not have 
> extremely reliable escape analysis.


If stack allocation is removed and everything will be heap 
allocated, then it will be the day i get rid of D

If compilers bugs there are, they should be fixed

I don't understand why you even make that suggestion, a language 
without stack allocation can't be taken seriously


More information about the Digitalmars-d mailing list