2 ms·
When you fear about the branch miss, then you can also just call the method and catch the SIGSEGV. I think if you allow for the possibility of there being no i
by 1718627440 1y ago
When you fear about the branch miss, then you can also just call the method and catch the SIGSEGV. I think if you allow for the possibility of there being no implementation, then you can't really not have some decision there. This would also apply for say a C++ virtual method.
- frutiger 1y agoA SIGSEGV is not guaranteed when calling an address that does not have a function.
- 1718627440 1y agoAre you talking about C? In C it's not guaranteed whether a non existing function will result in an actual function call. As soon as an actual function call was generated by the compiler, a modern CPU is very likely to trap. We are talking about an optimization of a language implementation here. This would be very much written in a ASM or another language were this is defined.