https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26388

--- Comment #19 from Martin Sebor <msebor at gcc dot gnu.org> ---
You're right,  I had overlooked the "provided by the implementation" part.

I would not want implementations to have the latitude to omit explicit calls to
operator new() unless the operator were the default.  That would largely defeat
the purpose of the operators' replaceabilty: to be able to control the dynamic
allocation policy of a program.

But if there were a way to detect whether or not the operator has been replaced
(it seems there should be some trick) then dynamic memory allocated at local
scope and known not to escape could be replaced with stack space without
breaking anything.  I think that would be a useful optimization.

Reply via email to