RFC: New C++ Attribute: final (sorry, wrong subject)
Jim Wilson
wilson@specifixinc.com
Wed Mar 3 00:08:00 GMT 2004
Cheng, Cheuk wrote:
> When I compile the same source code without any optimizations (-O1, -O2,
> etc.) , then I can see a call to A::~A instead of ___builtin_delete().
GCC is an optimizing compiler. When you compile without optimization,
we call A::~A which calls delete. When you compile with optimization,
then we do function inlining, and we call delete directly, which is
faster. The function inlining will only occur if it is safe.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list