https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #8 from François Dumont fdumont at gcc dot gnu.org ---
Author: fdumont
Date: Wed Nov 5 19:16:13 2014
New Revision: 217154
URL: https://gcc.gnu.org/viewcvs?rev=217154root=gccview=rev
Log:
2014-11-04 François Dumont
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
François Dumont fdumont at gcc dot gnu.org changed:
What|Removed |Added
Status|NEW |RESOLVED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #7 from François Dumont fdumont at gcc dot gnu.org ---
Yes, looks like I had forgotten node with only a left child, too bad. My
initial plan was to use existing tree node algos in tree.cc but erase could not
be done without
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
Jonathan Wakely redi at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
Jonathan Wakely redi at gcc dot gnu.org changed:
What|Removed |Added
CC||fdumont at gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #3 from Jonathan Wakely redi at gcc dot gnu.org ---
Created attachment 33853
-- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33853action=edit
try to fix leak
The rightmost node is not necessarily a leaf, so set _M_nodes to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org ---
Does the same problem still exist in _M_extract?
This loop moves _M_nodes to the rightmost node again:
while (_M_nodes-_M_right)
_M_nodes =
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #5 from Jonathan Wakely redi at gcc dot gnu.org ---
Yes, it looks like we also need:
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -423,6 +423,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #6 from Jonathan Wakely redi at gcc dot gnu.org ---
This still leaks like a sieve without the second patch:
#include set
#include random
int main()
{
std::mt19937 rng;
std::uniform_int_distributionint d;