Plans for v7/basic_string -> mainline/ext

Paolo Carlini pcarlini@suse.de
Sat Jun 11 20:07:00 GMT 2005


Hi everyone,

as you may have noticed I added an alternate base class to v7
basic_string, implementing completely different trade-offs wrt the other
already present (largely similar to the traditional behavior): no
reference-counting, a simple optimization for short strings. The latter,
besides promising better performance for heavily MT applications, is
supposed to be very clean in its basic data structures, thus
automatically free from some annoying issues (i.e., no casts, no
alignment issues, no empty reps in static memory).

That said, by now I understand clearly that we want a version of this
code for mainline, as an extension ;) The plan then would be as follows:
1- Keep on testing the new code in v7-branch a little while more, in
order to sort out the most stupid bugs and problems. Say, 'til after
GCCSummit, end of June.
2- Add to mainline/ext a bare bone version of the new code, consisting
of: ext/rc_string.h, ext/sso_string.h, ext/string_util.h, basically
unchanged, + basic_string.h and basic_string.tcc trivially changed
renaming everywhere bacic_string to __versatile_string or something
similar + typedefs for char and wchar_t, everything inside namespace
__gnu_cxx, of course. *No* I/O, however, no operator>> and operator<<,
getline, the most tricky bits: in this way this step should be doable
very easily.
3- Add operator<<, operator>>, getline on __versatile_string, and,
possibly, conversions from/to std::basic_string objects.
4- Implement additional optimizations and more sophisticated ideas, like
forms of simulated move semantics.

Looks sane? In case you can figure out something wrong or not
straightforward, or that we could do vastly better more quickly, please
let me know!

Thanks,
Paolo.



More information about the Libstdc++ mailing list