John Colvin:

Sure, you have to keep track of the memory to make sure it doesn't survive past the current scope (or at least isn't used past that point, depending on how security critical your application is), but that's often trivial to do and saving the extra allocation can make a big difference to performance.

It's also bug-prone, so better to limit that usage to only the parts of the code that need the performance difference (often it's the profiler that tells where to use that). Rust language allows to perform similar things safely.

Bye,
bearophile

Reply via email to