diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-01-31 13:25:09 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-03-09 08:58:31 +0000 |
commit | 518e258d59adc976e2e8aa9a7f9ef36d8b8cdb66 (patch) | |
tree | 33b90cb45ebfa4cb6767db85caaafcf6ac83d404 /src/qml/memory/qv4heap_p.h | |
parent | 8b3cbc4403e3eac286613691c11aa1ded588da59 (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.h | 4 |
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; } |