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]

PR cleanup re locale caches


Now that there is a revised cache on mainline, and (assuming it goes
in) a cache for 3.3, the picture has changed on 3 PRs.

7076 iostream performance regression
9828 segfault in num_put<wchar_t>::put
10276 ostringstream mem leak

9828 and 10276 are resolved on both 3.3 and mainline.  The only issue
remaining is tests for these PRs.  I've attached the 9828 tests for
mainline.

Do we have tests for memleaks?  If not, I should just close 10276.

Finally, 7076 is now much improved, but not 100% solved.  Mainline is
currently about 10% slower than 2.95.  How much of a catch-all should
this bug be?  For instance, should it be an umbrella for getting
caching in place for facets beside numpunct?

Later,
Jerry


2003-06-30  Jerry Quinn  <jlquinn@optonline.net>

	PR libstdc++/9828
	* testsuite/22_locale/num_put.old/put/char/7.cc: New.
	* testsuite/22_locale/num_put.old/put/wchar_t/7.cc: New.

diff -r -u -N testsuite/22_locale/num_put.old/put/char/7.cc testsuite/22_locale/num_put/put/char/7.cc
--- testsuite/22_locale/num_put.old/put/char/7.cc	1969-12-31 19:00:00.000000000 -0500
+++ testsuite/22_locale/num_put/put/char/7.cc	2003-06-30 01:12:46.000000000 -0400
@@ -0,0 +1,41 @@
+// 2003-06-30 peturr02@ru.is
+
+// Copyright (C) 2003 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+#include <locale>
+
+// libstdc++/9828
+void test01()
+{
+  using namespace std;
+  typedef num_put<char> np_t;
+
+  ostringstream stream;
+  const np_t& np = use_facet<np_t>(stream.getloc());
+
+  np.put(stream, wcout, ' ', static_cast<long>(10));
+  VERIFY( stream.str() == ' ');
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff -r -u -N testsuite/22_locale/num_put.old/put/wchar_t/7.cc testsuite/22_locale/num_put/put/wchar_t/7.cc
--- testsuite/22_locale/num_put.old/put/wchar_t/7.cc	1969-12-31 19:00:00.000000000 -0500
+++ testsuite/22_locale/num_put/put/wchar_t/7.cc	2003-06-30 01:06:55.000000000 -0400
@@ -0,0 +1,42 @@
+// 2003-06-30 peturr02@ru.is
+
+// Copyright (C) 2003 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <sstream>
+#include <iostream>
+#include <locale>
+
+// libstdc++/9828
+void test01()
+{
+  using namespace std;
+  typedef num_put<wchar_t> npw_t;
+
+  wostringstream stream;
+  const npw_t& npw = use_facet<npw_t>(stream.getloc());
+
+  npw.put(stream, cout, L' ', static_cast<long>(10));
+  VERIFY( stream.str() == L' ');
+}
+
+int main()
+{
+  test01();
+  return 0;
+}


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