public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* differences of memory layout of virtual function table.
@ 2003-11-19  4:53 Susantha Kumara
  0 siblings, 0 replies; 4+ messages in thread
From: Susantha Kumara @ 2003-11-19  4:53 UTC (permalink / raw)
  To: gcc-help; +Cc: Damitha Kumarage

Hi all,

I am writing a C Wrapper mechanism for C++ objects. Here the memory layout
of the virtual table is very important. I am searching for the differences
of memory layouts of the object/virtual pointer table(vtable) with various
compilers (GCC, BC, VC++ etc).

I found that there is a difference of the virtual tables between the GCC
versions 2.96 and 3.2. The difference I found is in the offset for first
virtual function pointer,
	* in GCC 2.96 4th pointer (12-16th bytes) is the pointer to the first
virtual function, whereas
	* in GCC 3.2 3rd pointer (8-12th bytes) is the pointer to the first virtual
function

And in both GCC version I found that the pointer to the virtual destructor
is placed just before the first virtual function pointer. Is this guarenteed
always ?.

Any help for me to figure out how GCC synthesizes an object is greatly
appreciated.

Thanks,

Susantha.


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <3FBBA33A.80006@utmb.edu>]
[parent not found: <5.2.1.1.0.20031119064017.014af5d0@iplan-mn.corp.adobe.com>]
* Re: differences of memory layout of virtual function table.
@ 2003-11-22 23:57 Dara Hazeghi
  0 siblings, 0 replies; 4+ messages in thread
From: Dara Hazeghi @ 2003-11-22 23:57 UTC (permalink / raw)
  To: susantha; +Cc: gcc-help

Hi,

regarding layout changes in the vtable, this is
usually documented (for instance
<http://gcc.gnu.org/gcc-3.3/changes.html> and
<http://gcc.gnu.org/gcc-3.4/changes.html>.
Specifically 2.95, 3.0, 3.1 and 3.2 all have changes.
3.4 when it is released may also have changes wrt 3.3.

The option -fdump-class-hierarchy probably helps.

Dara

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-22 23:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19  4:53 differences of memory layout of virtual function table Susantha Kumara
     [not found] <3FBBA33A.80006@utmb.edu>
2003-11-20  4:53 ` Susantha Kumara
     [not found] <5.2.1.1.0.20031119064017.014af5d0@iplan-mn.corp.adobe.com>
2003-11-20  6:04 ` Susantha Kumara
2003-11-22 23:57 Dara Hazeghi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).