Warn about using the GC

claptrap clap at trap.com
Sun Jan 14 12:25:18 UTC 2024


On Sunday, 14 January 2024 at 09:45:49 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> On 14/01/2024 10:25 PM, Walter Bright wrote:
>>
> ```
>
> The transitive nature of ``@nogc`` where it checks function 
> calls is the only behavior that needs to be disabled. 
> Everything else is good for such an addition. Although AA 
> mutation and ``.length =`` should probably be kept. Too easy to 
> do them without realizing it.
>
> The goal here is to prevent unnecessary work, that is almost 
> certain to have been done by accident.

I couldnt disagree more. That's just one use case, my use case, 
and anyone doing real time code, is we want to be sure there's no 
GC calls anywhere in the call graph. It's not just the odd hot 
loop.

@nogc not being transitive would be like @safe not being 
transitive, it would be useless for me.


More information about the Digitalmars-d mailing list