X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
From: Tatsuro MATSUOKA <matsuoka@mol.nagoya-u.ac.jp>
To: Danny Smith <dannysmith@clear.net.nz>
Cc: matsuoka@nuce.nagoya-u.ac.jp, cygwin@cygwin.com
Date: Tue, 11 Sep 2007 07:51:36 +0900
Subject: Re: gcc-dw2? or fast sjlj-exceptions EH
Reply-To: matsuoka@nuce.nagoya-u.ac.jp
In-Reply-To: <000001c7f3f6$e64897d0$276d65da@THOMAS>
References: <000001c7f3f6$e64897d0$276d65da@THOMAS>
Message-Id: <20070911075136.7389DD60.matsuoka@mol.nagoya-u.ac.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Mailer: nPOP Ver 1.0.9
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Thank you Danny.

My ability is not high enough so that I will discuss your suggestion 
in the Octave ML.

Tatsuro MATSUOKA


Danny Smith <dannysmith@clear.net.nz> wrote:
(2007/09/11 07:06)

>At http://www.cygwin.com/ml/cygwin/2007-09/msg00194.html
>
>Tatsuro Matsuoka wrote:
>
>> The best solution, I think, the speed of sjlj-exceptions EH on the 
>> cygwin is as fast as that of other platforms.
>> 
>
>In the case of octave, I believe that the main cause of slowdown is the
>sjlj EH code generated in prologue of new()
>Does a no-throw override of libary version of these functions help ?  
>
>
>Danny
>#ifdef __USING_SJLJ_EXCEPTIONS__
>#define NEW_THROW_SPEC throw()
>#else
>#define NEW_THROW_SPEC throw(std::bad_alloc)
>#endif 
>
>#include ...
>
>void *
>operator new (std::size_t sz) NEW_THROW_SPEC
>{
>  void *p;
>
>  /* malloc (0) is unpredictable; avoid it.  */
>  if (sz == 0)
>    sz = 1;
>  p = (void *) malloc (sz);
>  while (p == 0)
>    {
>      new_handler handler = __new_handler;
>      if (! handler)
>#ifdef __USING_SJLJ_EXCEPTIONS__
>        std::abort();
>#else
>	  throw bad_alloc();
>#endif
>      handler ();
>      p = (void *) malloc (sz);
>    }
>
>  return p;
>}
>
>void *
>operator new[] (std::size_t sz) NEW_THROW_SPEC
>{
>  return ::operator new(sz);
>}
>
>
>--
>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/


--
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/

