aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4typedarray_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-09-09 15:37:57 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-10-06 11:44:08 +0000
commit3b14e2ffdd8eb4b7f7f4508768b75f2acc399370 (patch)
tree7943f293bf2d0d376d5dc620448bab1a2b58027d /src/qml/jsruntime/qv4typedarray_p.h
parent1b90dc4482d001512f09a5785d4cbd8030879d82 (diff)
QML: Make Heap::Object and all subclasses trivial
GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4typedarray_p.h')
-rw-r--r--src/qml/jsruntime/qv4typedarray_p.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4typedarray_p.h b/src/qml/jsruntime/qv4typedarray_p.h
index d96027b96a..0112d2e4a1 100644
--- a/src/qml/jsruntime/qv4typedarray_p.h
+++ b/src/qml/jsruntime/qv4typedarray_p.h
@@ -86,7 +86,7 @@ struct TypedArray : Object {
NTypes
};
- TypedArray(Type t);
+ void init(Type t);
const TypedArrayOperations *type;
Pointer<ArrayBuffer> buffer;
@@ -96,13 +96,13 @@ struct TypedArray : Object {
};
struct TypedArrayCtor : FunctionObject {
- TypedArrayCtor(QV4::ExecutionContext *scope, TypedArray::Type t);
+ void init(QV4::ExecutionContext *scope, TypedArray::Type t);
TypedArray::Type type;
};
struct TypedArrayPrototype : Object {
- inline TypedArrayPrototype(TypedArray::Type t);
+ inline void init(TypedArray::Type t);
TypedArray::Type type;
};
@@ -160,10 +160,11 @@ struct TypedArrayPrototype : Object
static ReturnedValue method_subarray(CallContext *ctx);
};
-inline
-Heap::TypedArrayPrototype::TypedArrayPrototype(TypedArray::Type t)
- : type(t)
+inline void
+Heap::TypedArrayPrototype::init(TypedArray::Type t)
{
+ Object::init();
+ type = t;
}
} // namespace QV4