Re: Construction vtables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Construction vtables



> But, that means this trick doesn't work during object construction,
> which seems bad.
> 
> What am I missing?

Nothing, you are correct.  One of the tradeoffs in not including
secondary vtables that did not need construction vtables in the
construction vtables and VTT, was that you cannot reference secondary
vtables from the address of the primary vtable.  That's why the VTT
contains secondary vptrs, not just construction vtable ptrs.

There were two ways to do construction vtables: include the entire primary/
secondary vtable group in the construction vtable, or only include the ones
that needed construction vtables.  I wrote up (and implemented) both.
We chose the latter to save static space over the optimization you
describe.  We believed that the "boring" virtual tables would be large
enough to merit this space savings.

Coleen
-- 
-----------------------------------------------------------------------
Coleen Phillimore                  | mailto:coleen@xxxxxxxxxxx
Compaq Computer Corp.   Nashua, NH | COMPAQ C++ Compiler Development
-----------------------------------------------------------------------