public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Susantha Kumara" <susantha@opensource.lk>
To: <gcc-help@gcc.gnu.org>
Cc: "Damitha Kumarage" <damitha@opensource.lk>
Subject: differences of memory layout of virtual function table.
Date: Wed, 19 Nov 2003 04:53:00 -0000	[thread overview]
Message-ID: <FGEILGKBIIFKCIFLPBOFOEFKCBAA.susantha@opensource.lk> (raw)

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.


             reply	other threads:[~2003-11-19  4:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19  4:53 Susantha Kumara [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FGEILGKBIIFKCIFLPBOFOEFKCBAA.susantha@opensource.lk \
    --to=susantha@opensource.lk \
    --cc=damitha@opensource.lk \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).