diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-24 14:29:40 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-24 14:32:37 +0100 |
commit | ab2b5219876a60867e67b47827196114d238155d (patch) | |
tree | c2ecc7d22dcb8c4eadeede664ba97b3be64baffe /src/qml/jsruntime/qv4objectproto.cpp | |
parent | c53fef423a8f607e1443b1d409712864f8cac9d5 (diff) |
Allocate the ArrayData object and it's data together
Reduce the amount of allocations required for Arrays, and
allows freeing the array data more easily in the GC.
Change-Id: I3e3213f089c45c83a227038ce444aa60b2735b7f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index e8623d131d..51d6b8d414 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -273,7 +273,7 @@ ReturnedValue ObjectPrototype::method_seal(CallContext *ctx) o->internalClass = o->internalClass->sealed(); if (o->arrayData) { - o->arrayData->ensureAttributes(); + ArrayData::ensureAttributes(o.getPointer()); for (uint i = 0; i < o->arrayData->alloc; ++i) { if (!o->arrayData->isEmpty(i)) o->arrayData->attrs[i].setConfigurable(false); @@ -298,7 +298,7 @@ ReturnedValue ObjectPrototype::method_freeze(CallContext *ctx) o->internalClass = o->internalClass->frozen(); if (o->arrayData) { - o->arrayData->ensureAttributes(); + ArrayData::ensureAttributes(o.getPointer()); for (uint i = 0; i < o->arrayData->alloc; ++i) { if (!o->arrayData->isEmpty(i)) o->arrayData->attrs[i].setConfigurable(false); |