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]

Re: layout of the g++ virtual tables


> Date: Wed, 5 Aug 1998 11:07:55 +0200
> From: Cyrille Comar <comar@act-europe.fr>

> I was wondering if there was some type specific information stored
> along with the virtual table.

Yes.  RTTI (if compiled with -frtti (which is the default)) is
included in all objects that have at least one vtable pointer.  There
you can get at things like the ``name'' of the class, the type
involved, base classes and the like.

In this case, I'll point you at the code.  See tinfo*.cc in the
compiler.

> In GNAT we store plenty of other information used among other thing
> to check the validity of the downcasts

This can be done.

> Wouldn't the first 2 words be used for something like that by any
> chance?

Yes.


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