delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/16/15:07:50

X-Spam-Check-By: sourceware.org
Date: Thu, 16 Mar 2006 15:07:29 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
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
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
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019