This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] PR 8761 and 7076, take 3
- From: "Steven King" <sxking at qwest dot net>
- To: "Jerry Quinn" <jlquinn at optonline dot net>, libstdc++ at gcc dot gnu dot org
- Date: Tue, 21 Jan 2003 22:39:06 -0800
- Subject: Re: [patch] PR 8761 and 7076, take 3
- References: <E18arXk-0008Gl-00@tiamat> <E18bBLJ-0007yf-00@tiamat>
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...