diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-01-04 15:58:58 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-01-25 08:31:06 +0000 |
commit | 3e67a40860e0cda4cf6118c97e47cbe55aa672d6 (patch) | |
tree | 6e6cb9bc96b57b39602fde70b874fbb148b2bfd8 /src/qml/memory/qv4mm_p.h | |
parent | 1df5fb40b5417995f4121c15392f56a7bb19e0c2 (diff) |
Inline creation of simple call contexts
And avoid zero initializing stuff that's already 0
Change-Id: If90a808815b2b735bab661d22cbd498acc96b029
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/memory/qv4mm_p.h')
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 76017f8148..00daf8a622 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -206,8 +206,15 @@ public: Q_DECL_CONSTEXPR static inline std::size_t align(std::size_t size) { return (size + Chunk::SlotSize - 1) & ~(Chunk::SlotSize - 1); } - QV4::Heap::CallContext *allocSimpleCallContext() - { return stackAllocator.allocate(); } + QV4::Heap::CallContext *allocSimpleCallContext(QV4::ExecutionEngine *v4) + { + Heap::CallContext *ctxt = stackAllocator.allocate(); + memset(ctxt, 0, sizeof(Heap::CallContext)); + ctxt->setVtable(QV4::CallContext::staticVTable()); + ctxt->init(v4); + return ctxt; + + } void freeSimpleCallContext() { stackAllocator.free(); } |