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: Lawrence Crowl <crowl@xxxxxxxxxx>
- Subject: Re: [cxx-abi-dev] Deleted virtual functions
- From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
- Date: Fri, 29 May 2009 12:19:09 -0700
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@xxxxxxxxxxxxxxxx
(650) 331-3385 x713