This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: EGCS: pointer to member functions.
- To: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Subject: Re: EGCS: pointer to member functions.
- From: Jason Merrill <jason at cygnus dot com>
- Date: 22 Jun 1999 00:11:24 -0700
- Cc: mrs at wrs dot com (Mike Stump), brendan at dgs dot monash dot edu dot au, egcs at egcs dot cygnus dot com, martin at mira dot isdn dot cs dot tu-berlin dot de, egcs-patches at egcs dot cygnus dot com
- References: <199906171530.IAA14508@kankakee.wrs.com> <oriu8h1gr1.fsf@saci.lsd.dcc.unicamp.br>
I'm really don't think this change is a good idea; going through a thunk
costs more than a simple test. With branch prediction, the cost of the
test is about zero, while the thunk adds an extra jump. This idea should
not go into projects.html.
The only reason to use thunks is to avoid paying for MI in single
inheritance code; for code that actually needs adjustments, offsets in the
vtable are a faster solution on modern architectures. Which solution you
choose for calling virtual functions depends on how you view the tradeoff.
Jason