Re: [Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-12 Thread Bernhard
An: interest@qt-project.org > Betreff: Re: [Interest] Strange behaviour of QByteArray reserve/reallocation > mechansim > > El Monday 10 November 2014, Bernhard escribió: > > So after all I am not supposed to use clear() or operator=() after > > calling reserve()? That should be do

Re: [Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-12 Thread Alejandro Exojo
El Monday 10 November 2014, Bernhard escribió: > So after all I am not supposed to use clear() or operator=() after calling > reserve()? That should be documented. Without that knowledge it obviously > is impossible to use reserve() in a sensible way. There was a similar question on the developmen

Re: [Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-10 Thread Thiago Macieira
On Sunday 09 November 2014 10:34:28 Bernhard wrote: > Hi there! > > I just experienced a strange behavior of QByteArray regarding its internal > reallocation behavior. Actually that behavior stops me from using > capacity()/reserve() to optimize the allocation behavior and its seem to me > that un

Re: [Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-10 Thread Bernhard
> QByteArray a, b; > a.reserve(1000); > a = b; > > There's no way you will ever preserve the reserve(), because that would > conflict with the implicit sharing. This is no problem since I don't do this. But I see your point. This surely limits usability of reserve(). > So in your case you use an

Re: [Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-10 Thread Bo Thorsen
Hi Bernhard, Den 09-11-2014 kl. 10:34 skrev Bernhard: > I just experienced a strange behavior of QByteArray regarding its internal > reallocation behavior. Actually that behavior stops me from using > capacity()/reserve() to optimize the allocation behavior and its seem to me > that under current

[Interest] Strange behaviour of QByteArray reserve/reallocation mechansim

2014-11-09 Thread Bernhard
Hi there! I just experienced a strange behavior of QByteArray regarding its internal reallocation behavior. Actually that behavior stops me from using capacity()/reserve() to optimize the allocation behavior and its seem to me that under current conditions reserve() is more or less useless. Using