2 ms·
> Only if a1, a2, a3 are also freed at once. Yes exactly. This is meant to be illustrative of the case suggested in the parent comment, where all required run
by skohan 7y ago
> Only if a1, a2, a3 are also freed at once.
Yes exactly. This is meant to be illustrative of the case suggested in the parent comment, where all required runtime objects are known and can be initialized together at the beginning of execution.
edit: it may be possible to program around some of the worst performance pitfalls of RAII in many cases, but you will end up with very non-idiomatic code, which I would take as evidence that RAII is not ideal for memory performance.