Typical security issues in C++: why the GC isn't your enemy

Walter Bright newshound2 at digitalmars.com
Fri Dec 9 01:55:22 UTC 2022


On 12/8/2022 4:24 PM, deadalnix wrote:
> I do not expect this to be that expensive. It is simpler than the escape 
> analysis that is being baked in the language right now, and roughly on par with 
> keeping track of constructors/destructors.

I've done it. It's expensive. It is not on par with ctors/dtors which rely on 
FILO scope analysis, not data flow.

D's borrow checker does do DFA, and it's slow, and one of the reasons why it's 
active only with @live annotations. Rust uses DFA, and is notoriously slow.

D always initializes variables, and then the (optional) optimization pass 
removes the unneeded ones. This is a reasonable approach.



More information about the Digitalmars-d mailing list