[cxx-abi-dev] Deleted virtual functions
Mark Mitchell
mark at codesourcery.com
Fri May 29 19:19:09 UTC 2009
Lawrence Crowl wrote:
>> 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.
>
> Why is this a concern? The tables are in .rodata and bounded by
> the number of distinct classes, which is generally quite reasonable.
On small embedded systems, every byte counts. Period.
For example, some of the new Luminary Micro ARM-based parts have 8K
flash. And, yes, people want to use C++ on such systems.
> I am not convinced that a new compiler will be able to use an old
> library in general.
It may not. But, that's up to the compiler. If the ABI mandates that
virtual table slots for deleted virtual functions *must* contain the
address of __cxa_deleted_virtual that prevents what might be a good
implementation choice on some systems. For example, someone might want
to be able to use deleted virtual functions on an existing Linux
distribution, without having to upgrade libstdc++.
--
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713
More information about the cxx-abi-dev
mailing list