diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-10-08 10:05:06 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2014-10-09 09:41:40 +0200 |
commit | 05663e29d047851adb9a1ef440fb78b38ff3cc9b (patch) | |
tree | 4a796dfa9910f0483150e0e25f007d8d1a664382 /src/platformsupport | |
parent | 4a2cf9ca4174ee9879bfc5858f10dacc028a521f (diff) |
moc: don't use QByteArrayLiteral
The byte array literals are only used to append them to another
QByteArray, so they offer only the static size calculation as a
benefit.
However, there are several drawbacks:
- QByteArrayLiteral data cannot be shared the way string literals
can be, not even within a single TU, and they add a few ints
for the QByteArrayData header which cannot reside in BSS, but
need to be stored in DATA.
- QByteArrayLiteral *does* allocate when the compiler doesn't
support C++11 lambdas.
- QByteArrayLiteral, when not using RVO, litters the code with
QByteArray dtor calls, which are not inline, and thus can't
be optimized away.
In particular, when used like this, they do not prevent any
memory allocation (in fact, they might add some, absent lambdas).
So, just append (C) string literals.
Change-Id: Iee5dba8dd970c5cc6df116afc1f8709a62356b06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/platformsupport')
0 files changed, 0 insertions, 0 deletions