Virtual base alignment

Jim Dehnert dehnert at baalbek.engr.sgi.com
Thu Dec 30 01:47:25 UTC 1999


Mark's observation raises yet another question about virtual bases,
which I've opened as issue A-18.  I've described it as:

  Since the allocation of virtual bases is "floating" relative to the
  classes in which they occur, it is possible for them to have
  independent alignment constraints.  Specifically, when allocating a
  base class with a virtual base, we could treat its alignment as that
  obtained by ignoring the virtual base, and later allocate the
  virtual base with greater alignment.

  Since the class with a virtual base already has a vptr, this only
  matters if the virtual base contains components more strictly aligned
  than a pointer.  Thus, the benefit of doing so is probably not large.
  To get some idea of the effect on the layout definition, look at
  dsize and nvsize, and assume a similar pair of alignment values.

(For that last, you'll have to wait for my new version of
abi-layout.html tomorrow.)

Jim

-		Jim Dehnert  x3-4272




More information about the cxx-abi-dev mailing list