vcall slots and destructors

Mark Mitchell mark at codesourcery.com
Sun Feb 18 05:37:55 UTC 2001


>>>>> "Jason" == Jason Merrill <jason at redhat.com> writes:

    Jason> I recently noticed that g++ allocates to vcall slots for a
    Jason> virtual destructor, one for each of the variants that go
    Jason> into the vtable.  It seems to me that we only need one,
    Jason> since they can't be overridden separately.

I agree.

I will make the appropriate change to G++, and check our other
implementations.

Alex, I think the change we need is:

  2.5.3:

    Add the following sentence to the second bullet in the second set
    of bullets:

    "Although a virtual destructor receives two virtual table
     entries, there is only one vcall offset entry for a virtual
     destructor.  (Note that any overriding destructor will override
     both variants.)"

(I'd make this change myself, but I'm not sure what the appropriate
procedure is.  Feel free to clue me in privately.)

    Jason> Also, is it explicitly stated anywhere that the VTT parm
    Jason> comes right after 'this'?  That makes the most sense to me,
    Jason> but I don't see it written down anywhere.

It is stated in 3.3.1:

  They pass the address of the subobject's sub-VTT entry in the VTT as
  a second parameter when calling the subobject (not-in-charge)
  constructors and destructors.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list