aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-07-07 15:38:01 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-08-04 14:32:39 +0000
commit234e762265f0b538e65d610751b8488cb596824d (patch)
treea89a34a09de8ccc8ec87599257a11ec98da0a841 /src/qml/compiler/qv4compileddata_p.h
parent01575a22ea2d2e54ef1748733929243ca024234b (diff)
Use on-disk compilation unit if available
If we succeeded in saving the compilation unit to disk, then attempt to use it right away. This replaces the C++ heap usage for the compilation unit data as well as the anonymous allocated executable memory with file-backed mmap'ed memory. That means the memory can be discarded when overall availability is low and paged in on-demand. Change-Id: Ide1b1e11752d861eb049a99a26ca12cec5e2502e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index d6537bbab3..639c79f79b 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -666,8 +666,10 @@ struct Unit
return QString();
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
const QChar *characters = reinterpret_cast<const QChar *>(str + 1);
- if (flags & StaticData)
- return QString::fromRawData(characters, str->size);
+ // Too risky to do this while we unmap disk backed compilation but keep pointers to string
+ // data in the identifier tables.
+ // if (flags & StaticData)
+ // return QString::fromRawData(characters, str->size);
return QString(characters, str->size);
#else
const LEUInt16 *characters = reinterpret_cast<const LEUInt16 *>(str + 1);