On Thu, Mar 16, 2006 at 07:41:18PM +0000, Eric Blake wrote: >One more thing to be aware of - the reason cygwin uses this (IMHO very >slick) feature of C++ is that it is more efficient to assume that code >will not fault, and blindly deference pointers with the minimal >overhead of setting up the setjmp buffer with a pre-installed exception >handler already prepared for this usage, than it is to use a syscall to >Window's routines to validate every pointer before dereferencing it. >On the exceptional case that the code actually did get passed a bad >pointer, the overhead of the exception handling and longjmp are slower, >but that is okay since it is the exception. > >So maybe it looks weird. C++ is like that!
This isn't really c++ working here. It is basically longjmp working in concert with cygwin's own exception detection mechanism that is used when a program gets a SIGSEGV, SIGILL, etc. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/