octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion from Cygwin ML to solve slowness due to sjlj EH


From: Tatsuro MATSUOKA
Subject: Suggestion from Cygwin ML to solve slowness due to sjlj EH
Date: Tue, 11 Sep 2007 08:06:54 +0900 (JST)

Dear sirs

This is Tatsuro MATSUOKA writing.

I am now talking with slowness problem of the octave on cygwin due to sjlj EH.

Danny Smith gave me a suggestion.  That is wriiten after '****************'.
I would like to try this suggestion.   However, my knowledge is too poor to use 
his suggestion.
Does any one help me on this matter?
 
****************************************
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);
}

 

--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]