diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-07-10 13:39:20 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-08-24 00:17:04 +0200 |
commit | 76e8e8e9c8093f093cb9f37d61d273f43398fefb (patch) | |
tree | 9fc52a731ac9bae072ee2bf61feb728c7c517917 /tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | |
parent | cb17157b2762ca5deebe16d4867346437acf3fe0 (diff) |
Always use the variants internal space if possible
There's no point in storing small types with an external
refcount, even if they aren't movable. Simply copying
the type should be faster in pretty much all cases, while
this uses less memory.
Change-Id: I127474f8e3c5fa042f530684f9d5bfccbba134ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index e18b6e024a..4e67f42dce 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -1909,7 +1909,7 @@ void tst_QVariant::userType() QCOMPARE(instanceCount, 3); { QVariant second = myCarrier; - QCOMPARE(instanceCount, 3); + QCOMPARE(instanceCount, 4); second.detach(); QCOMPARE(instanceCount, 4); } @@ -3315,6 +3315,8 @@ struct MyNotMovable if (!ok) qFatal("MyNotMovable has been moved"); return ok; } + // Make it too big to store it in the variant itself + void *dummy[4]; }; int MyNotMovable::count = 0; |