This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
sizeof with virtual inheritance
- From: Adrian Sandor <aditsu at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 27 Apr 2004 04:48:26 +0000 (UTC)
- Subject: sizeof with virtual inheritance
Hello,
I would like to know why the size of class objects grows when virtual
inheritance is involved. I suppose the compiler adds some extra pointers to
them; I would like to know what they are for and why they are necessary, and if
it's possible to avoid them (or use at most one extra pointer).
I googled for this a bit, and I found an answer which suggests the use of an
attribute called "onevtable", but I can't find any other reference about it.
I'm using gcc 3.2 (I know, I know..) on Windows (mingw). I could switch to gcc
3.3.x if necessary.
Thanks
Adrian