aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compilationunitmapper_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <[email protected]>2016-08-09 11:09:24 +0200
committerSimon Hausmann <[email protected]>2016-08-09 09:44:00 +0000
commit186887aa56b68a2c0d9049759415db7307123137 (patch)
tree98b0246dad22941d84c1cd057bddd2ccd66ae2a7 /src/qml/compiler/qv4compilationunitmapper_p.h
parent3cba637ea6b4109171e5cab678f5ccecaed40809 (diff)
Reduce file descriptor pressure on Unix platforms
When opening cached compilation units, we can close the file descriptor after mmap'ing the contents, on Unix platforms. Change-Id: Ifb797a69743ebdc5e55db0b2e52b5cd66d071ca3 Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4compilationunitmapper_p.h')
-rw-r--r--src/qml/compiler/qv4compilationunitmapper_p.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compilationunitmapper_p.h b/src/qml/compiler/qv4compilationunitmapper_p.h
index 06ca3d0e02..119111ccd6 100644
--- a/src/qml/compiler/qv4compilationunitmapper_p.h
+++ b/src/qml/compiler/qv4compilationunitmapper_p.h
@@ -66,13 +66,20 @@ class CompilationUnitMapper
{
public:
CompilationUnitMapper();
+ ~CompilationUnitMapper();
CompiledData::Unit *open(const QString &sourcePath, QString *errorString);
void close();
private:
+ static bool verifyHeader(const QV4::CompiledData::Unit *header, const QString &sourcePath, QString *errorString);
+
+#if defined(Q_OS_UNIX)
+ size_t length;
+#else
QFile f;
- uchar *dataPtr;
+#endif
+ void *dataPtr;
};
}