This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48391] tr1/memory's shared_ptr causing excessive system memory consumption
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Mar 2011 16:57:12 +0000
- Subject: [Bug c++/48391] tr1/memory's shared_ptr causing excessive system memory consumption
- Auto-submitted: auto-generated
- References: <bug-48391-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48391
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-31 16:57:05 UTC ---
to summarise: there's nothing wrong with shared_ptr itself, but prior to GCC
4.6 our mutex had no destructor, so if shared_ptr uses a mutex it leaks
resources
mingw seem to have changed something which made this latent bug show up in GCC
4.5, possibly changing the value of __gnu_cxx::__default_lock_policy from 2 to
1 (causing a mutex to be used in shared_ptr)
the GCC 4.6 branch has been fixed by this commit:
http://gcc.gnu.org/viewcvs?view=revision&revision=166917
someone could either backport that fix to TDM-GCC or set
__gnu_cxx::__default_lock_policy = 2