delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/10/18:06:39

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 11 Sep 2007 10:06:53 +1200
From: Danny Smith <dannysmith AT clear DOT net DOT nz>
Subject: RE: gcc-dw2? or fast sjlj-exceptions EH
To: matsuoka AT nuce DOT nagoya-u DOT ac DOT jp
Cc: Cygwin <cygwin AT cygwin DOT com>
Message-id: <000001c7f3f6$e64897d0$276d65da@THOMAS>
MIME-version: 1.0
X-Mailer: Microsoft Outlook, Build 10.0.2627
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

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/

- Raw text -


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