diff options
| author | Ivan Solovev <ivan.solovev@qt.io> | 2024-04-24 16:35:01 +0200 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-28 12:44:02 +0000 |
| commit | b0a7ace47d97dd173bf53d671c908f6f66b1d03d (patch) | |
| tree | 80f45dc2cb5d46b84a152949a14234dfb60fe9be /src/opengl/qopenglvertexarrayobject.cpp | |
| parent | 93f54e69208359d513f83cafa25544e55932e8a0 (diff) | |
MSVC: improve QASV(const char(&str)[N]) compilation time
The lengthHelperContainer() implementation for sizeof(Char) == 1 case
is using qstrnlen() for the non-constexpr case.
qstrnlen() is an inline function which is effectively a nullptr check
and a memchr() call.
For some reason, on MSVC this combination resulted in very slow
compilation for the user projects, where each call to
QObject::setObjectName() was hitting this codepath.
Fix it by replacing the qstrnlen() call with strnlen_s() for MSVC.
It seems that for now all versions of MSVC are affected. However,
introduce a new Q_COMPILER_SLOW_QSTRNLEN_COMPILATION definition,
which will allow us to check for the compiler version later on.
For now this definition is set for all MSVC versions unconditionally.
Fixes: QTBUG-124376
Change-Id: Id769bef1e950ffa756acf7af39d362fd8b112019
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d849cb80a4ba468e2c6097ebfcab384ddaec8e67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7faabcce1ad66e51a0f8ebbbe722591d6b220f70)
Diffstat (limited to 'src/opengl/qopenglvertexarrayobject.cpp')
0 files changed, 0 insertions, 0 deletions
