[Development] Question about QCoreApplicationData::*_libpaths

Thiago Macieira thiago.macieira at intel.com
Tue Jan 19 00:47:19 CET 2016


On Monday 18 January 2016 15:39:11 Thiago Macieira wrote:
> On Monday 18 January 2016 23:43:37 Marc Mutz wrote:
> > a) std::string is not a movable type (at least I get a heap corruption
> > when
> > marking it as such in GCC 5.3)
> 
> It used to be in C++98 and it is with libc++. The new C++11 std::string from
> libstdc++ is not relocatable. They implemented SSO by storing the "begin"
> pointer pointing to itself, so that the common operation of getting the
> begin pointer does not need a conditional.

Note that this is exactly how Qt 4's QString knew whether the data was 
allocated by itself or it was fromRawData. The Qt 5 one doesn't store the 
pointer, but an offset from the data would be, so offset == 0 means 
"allocated".

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list