[wx-dev] Removing string ref counting (was Re: wxString threadsafe)

Robert Roebling robert at roebling.de
Sun May 4 12:52:50 PDT 2008


Vadim Zeitlin wrote:

> Robert Roebling wrote:
> 
> RR> Vadim Zeitlin wrote:
> RR> 
> RR> > Hajo Kirchhoff wrote:
> RR> > 
> RR> > HK> So my strong wish for wxWidgets 2.9 and up would be to have a thread 
> RR> > HK> safe wxString class by default.
> RR> > 
> RR> > On most platforms this would be achieved by simply making wxUSE_STL=1
> RR> > the default so it's another argument in its favour.
> RR> 
> RR> I must be the only one who overlooked this. But anyway, what is this
> RR> an argument for: remove reference counting from the non-STL based
> RR> wxString, use STL, not use STL? 
> 
>  I'd say "use STL". Except that I'm very afraid that this will result in
> major problems with wx 3.0 adoption because of c_str() problem (which is
> far more serious than all the minor incompatibilities introduced so far).
> 
> RR> Having a thread-safe wxString class in STL mode and one that is not
> RR> thread-safe and has (very?) different performance characteristics in
> RR> non-STL mode doesn't look optimal.
> 
> Yes, so I guess we should replace our wxString implementation with a
> non-reference counted version using small string optimization (this is
> what all modern STL implementations use AFAIK).

Now the simple question: who can do that? We can simply start by
removing reference counting and maybe add short string optimisation
in a second step. Needless to say that the two authors of the 
current implementation of wxString would surely qualify best for
doing the above change :-)

  Robert




More information about the wx-dev mailing list