Re: use of vtbl

"Lieven Marchand" <mal@wyrd.be>
10 Aug 2002 01:59:59 -0400

          From comp.compilers

Related articles
use of vtbl Michael.Bantle@t-systems.de (Michael BANTLE) (2001-08-06)
Re: use of vtbl fjh@cs.mu.OZ.AU (2001-08-08)
Re: use of vtbl zoicasc@hotmail.com (Cristian Zoicas) (2002-08-04)
Re: use of vtbl gdr@soliton.integrable-solutions.net (Gabriel Dos Reis) (2002-08-10)
Re: use of vtbl mal@wyrd.be (Lieven Marchand) (2002-08-10)
Re: use of vtbl bill@gibbons.org (Bill Gibbons) (2002-08-10)
Re: use of vtbl haberg@matematik.su.se (Hans Aberg) (2002-08-14)
Re: use of vtbl loewis@informatik.hu-berlin.de (Martin v. =?iso-8859-1?q?L=F6wis?=) (2002-08-14)
| List of all articles for this month |
From: "Lieven Marchand" <mal@wyrd.be>
Newsgroups: comp.compilers
Date: 10 Aug 2002 01:59:59 -0400
Organization: Only under extreme pressure
References: 01-08-021 02-08-018
Keywords: C++
Posted-Date: 10 Aug 2002 01:59:59 EDT

"Cristian Zoicas" <zoicasc@hotmail.com> writes:


> [I gather that the C++ standards committee came very close to defining
> the structure of a vtbl, so portable code could mess with them. I
> suspect you'll find that no matter which compiler you use, the vtbls are
> all about the same. -John]


There are a number of different strategies possible. You not only need
a table of function pointers, you also need to find the subobject the
function is refering too. In some implementations this is done by
keeping a table of offsets in the vtbl, in others it's done by letting
the function in the table be a trampoline that adjusts the this
pointer before jumping to the real function. I don't recall the
standards committee ever talking about an API into these things.


--
Bored, now.
Lieven Marchand <mal@wyrd.be>


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.