Re: [cxx-abi-dev] Deleted virtual functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cxx-abi-dev] Deleted virtual functions
- To: Dennis Handly <dhandly@xxxxxxxxxx>
- Subject: Re: [cxx-abi-dev] Deleted virtual functions
- From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
- Date: Fri, 29 May 2009 08:22:14 -0700
Dennis Handly wrote:
> Well, why have __cxa_pure_virtual without using it? ;-)
I do not think it would be a good idea to require that a compiler put
__cxa_pure_virtual into the virtual table. For code-size optimization,
having a simple NULL pointer is better. (Note that some implementations
of __cxa_pure_virtual call fprintf, and thereby drag in the whole I/O
library; it's not just the cost of the __cxa_pure_virtual function
itself.) And in some environments, there may be better functions to call.
I view __cxa_pure_virtual as a requirement on a conforming library, not
on a conforming compiler. The run-time library must provide this
function, so that compilers that choose to use it can put it in the
virtual table. Therefore, I believe the current "may" wording is
intentional and desirable.
I also think that precedent should be followed for the new
__cxa_deleted_virtual. One advantage of that is that a compiler that
wants to work with an older run-time library (i.e., one that does not
contain __cxa_deleted_virtual) can use a NULL pointer.
--
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713