aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-04-22 11:51:09 +0200
committerLars Knoll <lars.knoll@qt.io>2017-04-22 12:28:37 +0200
commit7d1b3b23897359b4ba51747229261867993536a8 (patch)
treee6fd5a89383535a8cf9b65d07403a2950d839bcd /src/qml/memory
parentc50113aaf4515c172a1dd2eb30532de088307d78 (diff)
parent93bc4113f06dce4c942374d765bef20054cd1f94 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/qml/memory')
-rw-r--r--src/qml/memory/qv4mm.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index a0cfd5d925..c4bd1a733f 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -165,6 +165,13 @@ struct MemorySegment {
size_t pageSize = WTF::pageSize();
size = (size + pageSize - 1) & ~(pageSize - 1);
+#if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN)
+ // Linux and Windows zero out pages that have been decommitted and get committed again.
+ // unfortunately that's not true on other OSes (e.g. BSD based ones), so zero out the
+ // memory before decommit, so that we can be sure that all chunks we allocate will be
+ // zero initialized.
+ memset(chunk, 0, size);
+#endif
pageReservation.decommit(chunk, size);
}