Re: use of vtbl

"Lieven Marchand" <>
10 Aug 2002 01:59:59 -0400

          From comp.compilers

Related articles
use of vtbl (Michael BANTLE) (2001-08-06)
Re: use of vtbl (2001-08-08)
Re: use of vtbl (Cristian Zoicas) (2002-08-04)
Re: use of vtbl (Gabriel Dos Reis) (2002-08-10)
Re: use of vtbl (Lieven Marchand) (2002-08-10)
Re: use of vtbl (Bill Gibbons) (2002-08-10)
Re: use of vtbl (Hans Aberg) (2002-08-14)
Re: use of vtbl (Martin v. =?iso-8859-1?q?L=F6wis?=) (2002-08-14)
| List of all articles for this month |

From: "Lieven Marchand" <>
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" <> 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 <>

Post a followup to this message

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