aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4propertykey_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-07-25 13:50:10 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-08-03 08:32:33 +0200
commit0b9fa18dfefc06f542bd0c98b7e41fa14aa0c2cf (patch)
tree5b61c47556699c04c4dfca8168061d1d6cc48d64 /src/qml/jsruntime/qv4propertykey_p.h
parentd8db6e9484884f9d93ef584e63e695ae0322fc8f (diff)
V4: Mark InternalClass parents when running GC
We need to preserve them as they notify us about protoId related changes. In order to avoid wasting heap space in case many properties are added and removed from the same object, we put a mechanism in place to rebuild the InternalClass hierarchy if many redundant transitions are detected. Amends commit 69d76d59cec0dcff4c52eef24e779fbef14beeca. Pick-to: 5.15 6.2 6.3 6.4 Fixes: QTBUG-91687 Task-number: QTBUG-58559 Change-Id: I3238931b5919ed2b98059e0b7f928334284ce7bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4propertykey_p.h')
-rw-r--r--src/qml/jsruntime/qv4propertykey_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4propertykey_p.h b/src/qml/jsruntime/qv4propertykey_p.h
index 87a8ed6392..a0e10e7675 100644
--- a/src/qml/jsruntime/qv4propertykey_p.h
+++ b/src/qml/jsruntime/qv4propertykey_p.h
@@ -15,6 +15,7 @@
//
#include <private/qv4global_p.h>
+#include <QtCore/qhashfunctions.h>
QT_BEGIN_NAMESPACE
@@ -109,6 +110,7 @@ public:
bool operator ==(const PropertyKey &other) const { return val == other.val; }
bool operator !=(const PropertyKey &other) const { return val != other.val; }
bool operator <(const PropertyKey &other) const { return val < other.val; }
+ friend size_t qHash(const PropertyKey &key, size_t seed = 0) { return qHash(key.val, seed); }
};
}