This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How does virtual function dispatch work in gcc?


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).



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]