This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] PR 8761 and 7076, take 3


On Tuesday 21 January 2003 07:14 pm, Jerry Quinn wrote:
> From: Nathan Myers <ncm-nospam at cantrip dot org>
>
> > On Tue, Jan 21, 2003 at 01:05:52AM -0500, Jerry Quinn wrote:
> > > OK, here is the next rendition of my patch for speeding up integer I/O
> > > output performance.
> >
> > Woohoo!  Once we get the nits below picked, let's check it
> > in and then work from that base.
> >
> > > @@ -142,6 +149,12 @@
> > >        // NB: This may be called more than once on the same object.
> > >        ios_base::_M_init();
> > >        _M_cache_facets(_M_ios_locale);
> > > +      if (!_M_fc)
> > > +	{
> > > +	  _Format_cache<_CharT>* __fc = new _Format_cache<_CharT>();
> > > +	  __fc->_M_init(*this);
> > > +	  this->_M_fc = __fc;
> > > +	}
> >
> > Hmm, is that exception-safe?
>
> If the new() fails, what is the right response?  As is, it will throw out
> the library, right?  Or am I missing something?

  Can __fc->_M_init(*this) throw?  if it does you'll leak the memory you just 
allocated...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]