Re: [Development] Changing container privates again

2012-06-11 Thread Thiago Macieira
On segunda-feira, 11 de junho de 2012 16.47.46, João Abecasis wrote: > The proposed QArrayAllocatedData is 32-bytes in size, but at the cost of two > 4-byte padding holes. That's not that much different from a 24-byte header > with no holes -- you can always add padding at the end ;-) > > With a 32

Re: [Development] Changing container privates again

2012-06-11 Thread João Abecasis
Thiago Macieira wrote: > On segunda-feira, 11 de junho de 2012 16.00.58, João Abecasis wrote: >> Thiago Macieira wrote: Following Olivier's suggestion I think it might be beneficial to have alloc unconditionally in the base class, even if it is not being used at times. If nothi

Re: [Development] Changing container privates again

2012-06-11 Thread Thiago Macieira
On segunda-feira, 11 de junho de 2012 16.16.59, João Abecasis wrote: > > However, I don't think that's going to be a very useful use-case. I > > already > > think that in-place modification of externally-allocated data is a stretch > > use- case, but one that could be eventually useful. Allowing th

Re: [Development] Changing container privates again

2012-06-11 Thread João Abecasis
Thiago Macieira wrote: > Ok, I see. You're splitting the deleter from the immutability. Since we do > have a flag for immutability, we can serve WebKit's use-case, but also do in- > place modifications. Yes. > I find that a nice use-case. > > You're going further and suggesting that we could al

Re: [Development] Changing container privates again

2012-06-11 Thread Thiago Macieira
On segunda-feira, 11 de junho de 2012 16.00.58, João Abecasis wrote: > Thiago Macieira wrote: > >> Following Olivier's suggestion I think it might be beneficial to have > >> alloc > >> unconditionally in the base class, even if it is not being used at times. > >> If nothing else, it saves padding.

Re: [Development] Changing container privates again

2012-06-11 Thread João Abecasis
Thiago Macieira wrote: >> Following Olivier's suggestion I think it might be beneficial to have alloc >> unconditionally in the base class, even if it is not being used at times. >> If nothing else, it saves padding. Additionally, deleter function and token >> would be more generally useful if they

Re: [Development] Changing container privates again

2012-06-11 Thread Thiago Macieira
On segunda-feira, 11 de junho de 2012 11.02.24, João Abecasis wrote: > > struct Q_CORE_EXPORT QArrayData > > { > > > >QtPrivate::RefCount ref; > >uint flags; > >int size; // ### move to the main class body? > >// -- 4 bytes padding here on 64-bit systems -- > >qptrdiff off

Re: [Development] Changing container privates again

2012-06-11 Thread João Abecasis
On 9. juni 2012, at 17.45, ext Thiago Macieira wrote: > Hello > > Moving the discussion from the series of patches I've begun on Gerrit to the > ML. > > tl;dr: all I wanted was to add the prepend optimisation to QVector so I could > work on QList. Then João told me of a request by Tor Arne ab

Re: [Development] Changing container privates again

2012-06-09 Thread Thiago Macieira
On sábado, 9 de junho de 2012 21.42.55, André Pönitz wrote: > My gut feeling says there is a sweet spot at 16 byte object size, > with direct pointer to the raw data, and size member and some > sensible use of the extra bits. Agreed, but it's 16 bytes on 64-bit architectures. On 32-bit ones, it wo

Re: [Development] Changing container privates again

2012-06-09 Thread André Pönitz
On Sat, Jun 09, 2012 at 05:45:01PM +0200, Thiago Macieira wrote: > [...] - André requested that the size member be moved away from the > header into the main class body itself. I haven't done that yet and > I'm not sure I should. It would be major surgery for something that we > haven't proven yet.

Re: [Development] Changing container privates again

2012-06-09 Thread Thiago Macieira
On sábado, 9 de junho de 2012 19.31.09, Olivier Goffart wrote: > Then, one can put back 'alloc' in QArrayData It's not worth it. It increases the size of the 32-bit structure and leaves us at a weird boundary on 64-bit ones. 32 bytes is actually good. -- Thiago Macieira - thiago.macieira (AT) int

Re: [Development] Changing container privates again

2012-06-09 Thread Olivier Goffart
On Saturday 09 June 2012 19:19:41 Thiago Macieira wrote: > On sábado, 9 de junho de 2012 19.15.09, Olivier Goffart wrote: > > I suggest re-ordering the offset in order to avoid padding. > > It doesn't help. > > > struct Q_CORE_EXPORT QArrayData > > { > > > > QtPrivate::RefCount ref; > >

Re: [Development] Changing container privates again

2012-06-09 Thread Thiago Macieira
On sábado, 9 de junho de 2012 19.15.09, Olivier Goffart wrote: > I suggest re-ordering the offset in order to avoid padding. It doesn't help. > struct Q_CORE_EXPORT QArrayData > { > QtPrivate::RefCount ref; > uint flags; > qptrdiff offset; // in bytes from beginning of header > in

Re: [Development] Changing container privates again

2012-06-09 Thread Olivier Goffart
On Saturday 09 June 2012 17:45:01 Thiago Macieira wrote: > Hello > > Moving the discussion from the series of patches I've begun on Gerrit to the > ML. > > tl;dr: all I wanted was to add the prepend optimisation to QVector so I > could work on QList. Then João told me of a request by Tor Arne abo

[Development] Changing container privates again

2012-06-09 Thread Thiago Macieira
Hello Moving the discussion from the series of patches I've begun on Gerrit to the ML. tl;dr: all I wanted was to add the prepend optimisation to QVector so I could work on QList. Then João told me of a request by Tor Arne about letting QString have a "notify of destruction" function. So I change