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: [v3] posix name, valgrind on the facets


> Wow! This is team work at its best!

Yep!

I checked your original valgrind case, it seems ok now. You might want
to re-check my results though.

A summary of steps for using valgrind effectively with libstdc++, for
the curious:

1) rebuild libstdc++ with CXXFLAGS=" -g -O0"
2) install, set LD_LIBRARY_PATHS etc.
3) get valgrind, install
4) run. 

Most of my valgrind runs were completed with:

FLAGS="-v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes"

valgrind $FLAGS a.out >& valgrind.log

I didn't run all the locale tests with this, just a few, and
concentrated on the ctors/dtors and facet creation/destruction/addition.

I'll pick this work up again and do a more complete analysis when the
glibc-2.3 bits are finished mapping _nl_C_locobj to the result from
newlocale(obj, "C", NULL). There is some noise in the results because of
this (15 and 64 byte leaks in _S_create_c_locale). Everything else seems
fine though, or mostly fine. (The named locale test in
22_locale/facets.cc is showing wonky results for moneypunct<wchar_t,
false> but I can't figure it out, and stepping through this stuff in gdb
indicates the proper deallocation of memory, so who knows.)

> P.S. As follow-ups we can envisage optimizing a bit the use of strtok() 
> and also adding
> some documentation (in particular, about setlocale() vs C++ locales, as 
> you suggested in
> private mail)

Ok. I did add your bit to the documentation about locale::global, and
setlocale vs. LANG.

The locale documentation in general needs to be overhauled. I was hoping
to get to it this past summer, but it never happened.

-benjamin


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