diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-01-18 17:11:15 +0000 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-01-19 14:09:47 +0000 |
commit | a6cdfacf8d9c646333e81693e73e2c74173ad29a (patch) | |
tree | 5d02c92e55165001d65aa3dcad3dc8f18f4f2119 /src/corelib/global/qhooks.cpp | |
parent | f46496602e855dccccb6052de0f7ccbc74db40cd (diff) |
QHostAddress: make it implictly shared
QHostAddress is one of the few classes in Qt which is pimpl'd but not
implictly shared, making it suprisingly expensive to copy around, return
by value and so on. Being pimpl'd it is also still lacking a move
constructor, like most of such types in Qt.
Remove a bit of the surprise factor and make it implictly shared. In
practice this means making it eagerly parse host addresses from strings.
Since it was entirely implemented out of line, replacing it with a
implictly shared implementation is binary compatible.
[ChangeLog][QtNetwork][QHostAddress] QHostAddress is now implicitly
shared.
Change-Id: Ia7ff94efcb74e7321b7607cd690c5c162f685605
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/corelib/global/qhooks.cpp')
-rw-r--r-- | src/corelib/global/qhooks.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qhooks.cpp b/src/corelib/global/qhooks.cpp index 7b9a3db30d..bbddb1cbf1 100644 --- a/src/corelib/global/qhooks.cpp +++ b/src/corelib/global/qhooks.cpp @@ -67,7 +67,7 @@ quintptr Q_CORE_EXPORT qtHookData[] = { // The required sizes and offsets are tested in tests/auto/other/toolsupport. // When this fails and the change was intentional, adjust the test and // adjust this value here. - 15 + 16 }; Q_STATIC_ASSERT(QHooks::LastHookIndex == sizeof(qtHookData) / sizeof(qtHookData[0])); |