This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How does virtual function dispatch work in gcc?
- From: Joe Buck <jbuck at synopsys dot com>
- To: Dennis Dams <dennis at research dot bell-labs dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 17 Jan 2003 11:15:37 -0800
- Subject: Re: How does virtual function dispatch work in gcc?
- References: <010801c2be54$1be50780$87366887@bl.belllabs.com>
On Fri, Jan 17, 2003 at 01:13:17PM -0500, Dennis Dams wrote:
> Can someone give me (or point me to) an explanation of how the virtual
> function dispatch mechanism works in gcc?
> thanks,
Every compiler I've ever heard of uses a virtual function table (vtable),
and each object that has virtual functions has a pointer to the vtable for
its class. But I presume that you know that and you'll looking for the
nitty-gritty details.
At least for the ia32 and ia64 platforms, see
http://www.codesourcery.com/cxx-abi/abi.html#vtable
for a complete spec (the document was written for ia64, but ia32 is the
same other than the size of the pointers).