differences of memory layout of virtual function table.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux