diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-11 17:46:00 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-12 11:18:51 +0100 |
commit | 7660c30e08975011c7bd47bcb1796139b9d77196 (patch) | |
tree | 26e86cbc35560ac5bdf3327ea29f146cc1821787 /src/qml/jsruntime/qv4executablecompilationunit.cpp | |
parent | ccc4b52e95ac90c14c59001f675409c1a13c183b (diff) |
Cache static compilation units
If we load the same file multiple times, we can re-use the old mapping.
In fact we may leak memory if we don't. The fact that we have to use a
mutex here is somewhat regrettable, but I haven't found a better way
of serializing access.
Task-number: QTBUG-89659
Pick-to: 5.15
Change-Id: Iaa44ac80faa5e95f30c05e950ab35083a8b0416b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index 5aaec63a05..8ef8ae2221 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -764,7 +764,7 @@ bool ExecutableCompilationUnit::loadFromDisk(const QUrl &url, const QDateTime &s const QStringList cachePaths = { sourcePath + QLatin1Char('c'), localCacheFilePath(url) }; for (const QString &cachePath : cachePaths) { - CompiledData::Unit *mappedUnit = cacheFile->open(cachePath, sourceTimeStamp, errorString); + CompiledData::Unit *mappedUnit = cacheFile->get(cachePath, sourceTimeStamp, errorString); if (!mappedUnit) continue; |