On Fri, Sep 13, 2019 at 08:33:31AM +0200, Thomas Klausner wrote: > I'm sorry, I totally do not get it the problem with -- in general -- > writing the code in such a way that it properly frees any allocations > it made. > > I suspect there will be corner cases where it will be really hard, and > we can discuss those separately. But discussing about adding a free() > in ps? (If it was done incorrectly, let's fix it.) > > Please enlighten me.
There sometimes is a non-trivial amount of work to do to properly free up everything. This gains us nothing when we know it happens exactly once before exiting. I remember timing a compiler pass where the runtime was cut to slightly about 50% by just avoiding freeing the AST (which was built once for the pass, of course). This obviously was decades before Rust and C++, but nevertheless - sometimes the time saving can be huge. Martin