aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4heap_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-01-31 13:25:09 +0100
committerLars Knoll <lars.knoll@qt.io>2017-03-09 08:58:31 +0000
commit518e258d59adc976e2e8aa9a7f9ef36d8b8cdb66 (patch)
tree33b90cb45ebfa4cb6767db85caaafcf6ac83d404 /src/qml/memory/qv4heap_p.h
parent8b3cbc4403e3eac286613691c11aa1ded588da59 (diff)
Make every member of a Heap object aware of its offset inside the object
This will allow adding a write barrier to those fields with manageable effort. Change-Id: I7d06d7ffccbcefe66e2524c64c962353c91c2766 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/memory/qv4heap_p.h')
-rw-r--r--src/qml/memory/qv4heap_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h
index febe4e6446..b3dfa407f8 100644
--- a/src/qml/memory/qv4heap_p.h
+++ b/src/qml/memory/qv4heap_p.h
@@ -164,8 +164,10 @@ struct Q_QML_EXPORT Base {
};
V4_ASSERT_IS_TRIVIAL(Base)
-template <typename T, size_t>
+template <typename T, size_t o>
struct Pointer {
+ static Q_CONSTEXPR size_t offset = o;
+ static Q_CONSTEXPR quint64 markBits = Mark_Pointer << (o >> 2);
T operator->() const { return ptr; }
operator T () const { return ptr; }