path: root/src/network/socket/qnativesocketengine_unix.cpp
diff options
authorThiago Macieira <>2017-08-20 14:22:44 -0700
committerThiago Macieira <>2017-09-13 16:19:45 +0000
commit3b61cd6ad738b8479bf216dcf736bb935e8812df (patch)
treede0c9c06a6d426c9c91e93342cf02208eb11b8ff /src/network/socket/qnativesocketengine_unix.cpp
parentad8a48e8f1b336099eab2a00c1c1e59abad8e717 (diff)
QStringView: De-inline the length calculation so we can use SSE2
Performance is more important in this case than the theoretical benefit of constexpr. This commit implements the SSE2 search for 16-bit null and it might be possible to implement the equivalent for AArch64 (investigation required). It also adds a fallback to wcslen() for systems where wchar_t is short (non-x86 Windows or 32-bit x86 build with -no-sse2). We can re-add the constexpr loop once the C++ language has a way of overloading constexpr and non-constexpr. GCC has a non-standard way to do that with __builtin_constant_p, which is also implemented in this commit, but note that the inline function is still not constexpr. Change-Id: I6e9274c1e7444ad48c81fffd14dcaacafda5ebdc Reviewed-by: Oswald Buddenhagen <> Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src/network/socket/qnativesocketengine_unix.cpp')
0 files changed, 0 insertions, 0 deletions