* Moritz Strübe:

> Hey.
>
> Am 11.05.2020 um 15:59 schrieb Thomas Neumann via Gcc:
>> In a way I am disagreeing with the paper, of course, in that I propose
>> to make the existing exception mechanism faster instead of inventing a
>> new exception mechanism. But what I agree on with P0709 is that it is
>> unfortunate that many projects disable exceptions due to performance
>> concerns. And I think the performance problems can be solved.
>
> I just wanted to point out that Herbceptions do not only fix
> performance issues, but also code-size problems. While anything below
> 4GB of RAM is considered under-powered for a PC, typical deep embedded
> environments have something around 32k of program memory and 2K of
> ram. And even those running Linux often have around 32MB program
> memory and 8MB of RAM. Also most of these systems are very cost
> sensitive, so each byte matters. Therefore RTTI and exceptions are one
> of the main reasons why parts of the embedded community consider C++
> unusable: They do some experiments using C++ and the code size
> explodes.  And even if you know what you are doing and turn interrupts
> and RTTI off, adding a std::nothrow to every "new" to do decent error
> handling is pretty annoying. Not mentioning the parts of the C++
> library that don't provide exception-free error-handling.

The flag-return proposal has costs as well, especially if applied
verbatim without any additional language changes.  There won't be large
tables, but code size will increase across all non-leaf, noexcept(false)
functions.

My worry is that the overhead will be enough to deter embedded users,
and then we are stuck with a third error handling approach for C++.

Thanks,
Florian

Reply via email to