diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-02-05 10:32:42 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-03-05 14:06:30 +0100 |
commit | bdb6246599595be462db9901efd3012e83093afc (patch) | |
tree | e0db0a362ab85d605b12316bd1be3587d452443b /src/qml/jsruntime | |
parent | a32bcfe03db015f0b0e8c2e217dd603ad23edbba (diff) |
ArrayData/MemberData: Prove Fixed gc interaction
When setting values on a newly allocated Array- or MemberData,
d7aa952e143accc18d54707d956d019272197078 made the assumption that it is
safe to skip the write-barrier, as the new values would be marked when
the "values" member would be written to (pushing the new data on the
mark stack, and then later marking all objects stored in values when it
gets popped and markObjects runs).
Now that we no longer do black allocations, this actually holds true.
Add a unit test to verify it.
Task-number: QTBUG-119274
Task-number: QTBUG-121910
Change-Id: Ia1ceeaffeaf30dc1fb2b9e1992dd0b599050294c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4memberdata.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp index 6c0fc3a183..0231641609 100644 --- a/src/qml/jsruntime/qv4memberdata.cpp +++ b/src/qml/jsruntime/qv4memberdata.cpp @@ -46,7 +46,7 @@ Heap::MemberData *MemberData::allocate(ExecutionEngine *e, uint n, Heap::MemberD if (oldSize > alloc) alloc = oldSize; m = e->memoryManager->allocManaged<MemberData>(alloc); - // no write barrier required here + // no write barrier required here, as m gets marked later when member data is set memcpy(m, old, oldSize); } else { m = e->memoryManager->allocManaged<MemberData>(alloc); |