virtual table

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

 



Hi,

suppose I have three classes Foo, Bar, Zoo.

Foo inherits from Bar,
Bar inherits from Zoo.

Bar and Zoo are abstract classes (as defined here : http://en.wikibooks.org/wiki/C%2B%2B_Programming/Classes/Abstract_Classes)

The size of Foo shall account for the two pointers to Bar an Zoo vtables.

I was wondering if there is a way to have the Zoo vtable reference pointer embedded in the Bar vtable, so that Foo only has to store one pointer, while the second vtable reference is resolved when accessing the first. I'm aware that there are motivations like casting or multiple inheritance behind having all vtables pointers attached to the object instance in "ram" memory, rather then within the vtable "in rom", but I was wondering if there was a more "ram-efficient" way to handle this (as the vtables and the way the work is not dictated by the standard), which gcc could support.

R




[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