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 ping


Paolo Carlini <pcarlini@suse.de> writes:

> Ian Lance Taylor wrote:

> >Patch for 4.1 regression PR libstdc++/13583 (limited memory leak in
> >threaded program):
> >    http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01550.html
> >  
> >
> Ian, I think your approach has a serious problem: we end up with
> different mutexes in different translation units (locale_facets.tcc is
> included byt <locale>) and this doesn't seem safe, in general.
> 
> I would be happy to be wrong, because the same approach would solve
> another issue in our shared_ptr code, as you may have noticed. Is there
> something I'm missing?

You're quite right.  My patch is completely bogus.  Thanks for
noticing that.

It would be easy to add a single instance of the mutex in
src/locale_init.cc.  But then code compiled with a newer version of
libstdc++ would not work with older versions of libstdc++.so, as there
would be an undefined symbol at link time.  Does that count as a bad
ABI change?  It would continue to be possible to use code compiled
with older versions of libstdc++ with the new libstdc++.so; the older
code just wouldn't use the mutex when initializing the cache.

Ian


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