[Interest] QVector / std::vector and memory alignment

Thiago Macieira thiago.macieira at intel.com
Fri Dec 30 12:52:45 CET 2016


Em sexta-feira, 30 de dezembro de 2016, às 11:45:22 BRST, Giuseppe D'Angelo 
escreveu:
> Il 29/12/2016 13:03, Thiago Macieira ha scritto:
> > How is it ia win for std::vector to achieve next year what QVector has
> > done
> > for the past 7 or 8?
> 
> Because with std::vector it has been possible for the last 16 years (by
> using a custom allocator), _and_ this behaviour has been well-defined by
> a Standard (unlike QVector, whose behaviour has always been undocumented
> / implementation defined, and possibly changed between Qt 3/4/5 and
> maybe will change again in Qt 6).

There was no QVector in Qt3. QValueVector and early Qt 4 QVector didn't 
support overalignment. Sometime along Qt 4.x, I added the necessary support 
and it has been carried over ever since.

I just never bothered to write it down in the docs.

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




More information about the Interest mailing list