c_plus_plus_zero-cost_exception_model

C++ zero-cost exception model

C Plus Plus zero cost exception model

Return to zero-overhead exception model

zero-cost exception model – a technique for implementing C++ exception handling whereby no instructions related to possible exceptions are inserted into the nonexceptional code path (a.k.a. the hot path). This technique maximizes the speed of execution along the hot path by avoiding a test, on each function call return, to check whether the called function exited via an exception. Instead, the compiler generates tables that are used to lookup and jump to appropriate exception-handling code (a.k.a. the cold path) when an exception is thrown. Some compilers go so far as to put the cold path in entirely separate memory pages so that it is not loaded into memory unless and until an exception is thrown, at the cost of much lower runtime performance on the presumably rare occasions when the cold path code is taken. noexcept Specifier (1134) (EMCppSfe 2021)

Fair Use Sources


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


c_plus_plus_zero-cost_exception_model.txt · Last modified: 2024/04/28 03:32 (external edit)