diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-08-29 22:25:51 +0200 |
---|---|---|
committer | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-09-05 11:52:44 +0000 |
commit | cef14c0ff9a0caaa5b65ab89825534b3fcbd4764 (patch) | |
tree | 46cb93062822bcc7d8c59fe89cb7801954119678 /src/qml/qml/qqmlvmemetaobject.cpp | |
parent | 217bca42934ecf9a5fab74bbddbfa852c9b1bfe6 (diff) |
Allocate QML defined properties without extra room
QV4::MemberData is used to allocate storage for QML defined properties.
QV4::MemberData::reallocate() is multiplying each allocation by two
as a growth strategy. This is a waste of memory for QML defined properties.
This commits extends the QV4::MemberData with an additional method
to allow exactly sized allocations.
Change-Id: I5c0a3a5a3852d39af9e1afb512380fb1400d2448
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 0ffeddbabc..4b19d1af04 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -1086,7 +1086,7 @@ void QQmlVMEMetaObject::allocateProperties() { Q_ASSERT(cache && cache->engine); QV4::ExecutionEngine *v4 = cache->engine; - QV4::Heap::MemberData *data = QV4::MemberData::reallocate(v4, 0, metaData->propertyCount); + QV4::Heap::MemberData *data = QV4::MemberData::allocate(v4, metaData->propertyCount); properties.set(v4, data); for (uint i = 0; i < data->size; ++i) data->data[i] = QV4::Encode::undefined(); |