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/jsruntime/qv4memberdata_p.h | |
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/jsruntime/qv4memberdata_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4memberdata_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h index 4c7cfa47cb..50b8ddb3d1 100644 --- a/src/qml/jsruntime/qv4memberdata_p.h +++ b/src/qml/jsruntime/qv4memberdata_p.h @@ -61,7 +61,8 @@ struct MemberData : Managed Value *data() { return d()->data; } inline uint size() const { return d()->size; } - static Heap::MemberData *reallocate(QV4::ExecutionEngine *e, Heap::MemberData *old, uint idx); + static Heap::MemberData *allocate(QV4::ExecutionEngine *e, uint n); + static Heap::MemberData *reallocate(QV4::ExecutionEngine *e, Heap::MemberData *old, uint n); static void markObjects(Heap::Base *that, ExecutionEngine *e); }; |