diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-26 09:49:36 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-31 17:08:31 +0000 |
commit | c549d9c4e58ef8b6f9c8d954dc24072ce529f326 (patch) | |
tree | 025b81a2ab85b76ff7183703eeb9835db5a03e96 /src/qml/compiler/qv4compiler_p.h | |
parent | a05d1796b88e628655afdba6063a186d3a0803bf (diff) |
Simplify loading of ahead-of-time created QML cache files
Consolidate the old "createUnitData" code that used to be a virtual
function into the one call site and avoid a malloc that way.
By the way of that, the string table gets a guard to prevent accidental
registerString() calls at a later point.
Change-Id: Ia3f8d3e874b7733822e6942e411c940ec60d95a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler_p.h')
-rw-r--r-- | src/qml/compiler/qv4compiler_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler_p.h b/src/qml/compiler/qv4compiler_p.h index bb9794358b..f2547f2d06 100644 --- a/src/qml/compiler/qv4compiler_p.h +++ b/src/qml/compiler/qv4compiler_p.h @@ -84,6 +84,8 @@ struct Q_QML_PRIVATE_EXPORT StringTableGenerator { uint sizeOfTableAndData() const { return stringDataSize + stringCount() * sizeof(uint); } + void freeze() { frozen = true; } + void clear(); void initializeFromBackingUnit(const CompiledData::Unit *unit); @@ -95,6 +97,7 @@ private: QStringList strings; uint stringDataSize; uint backingUnitTableSize = 0; + bool frozen = false; }; struct Q_QML_PRIVATE_EXPORT JSUnitGenerator { |