This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C++ space optimization: de-cloning con/de/structors
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>, Matt Austern <austern at apple dot com>
- Cc: Stuart Hastings <stuart at apple dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 08 Aug 2002 10:18:26 -0700
- Subject: Re: [PATCH] C++ space optimization: de-cloning con/de/structors
A better solution, it seems to me, is to factor the *tors properly. The
base ctor is a subroutine of the complete ctor, which is a subroutine of
the (optional) allocating ctor. The base dtor is a subroutine of the
complete dtor, which is a subroutine of the deleting dtor. Then it
becomes a question of inlining, rather than cloning.
Yes, this is better. Again, you have to watch out for variable arguments;
you either need some wacky magic, or you need to not actually be making
subroutine calls.
I actually thought about implementing it this way in GCC, but did not have
sufficient time to experiment with it.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com