X-Spam-Check-By: sourceware.org Date: Thu, 16 Mar 2006 15:07:29 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Bug in dlopen() (or following) code in Cygwin1.dll v 1.5.19-4 Message-ID: <20060316200729.GB14672@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <031620061941 DOT 903 DOT 4419BF5E000BEFE80000038722007456720A050E040D0C079D0A AT comcast DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <031620061941.903.4419BF5E000BEFE80000038722007456720A050E040D0C079D0A@comcast.net> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/