What should happen here?

deadalnix deadalnix at gmail.com
Sun Sep 26 19:13:57 UTC 2021


On Friday, 24 September 2021 at 15:31:46 UTC, Steven 
Schveighoffer wrote:
> On 9/24/21 11:25 AM, deadalnix wrote:
>> On Thursday, 23 September 2021 at 19:54:56 UTC, Steven 
>> Schveighoffer wrote:
>>> You can. But wouldn't you prefer just pushing something on 
>>> the stack?
>>>
>> 
>> Not really. If the optimizer can remove dead stack pushes, 
>> then program will become 2x slower instantly in addition of 
>> consuming more stack memory.
>> 
>
> You think pushing on the stack is going be 2x slower than 
> calling `GC.addRoot`?
>
> -Steve

If the optimizer isn't free to optimize thing away from the 
stack, yes, it's pretty much guaranteed.


More information about the Digitalmars-d mailing list