aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4mm_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-01-04 10:49:23 +0100
committerLars Knoll <lars.knoll@qt.io>2017-01-25 08:30:54 +0000
commitd8c6bf2dc129522f779d2c4ffc698a97b7531f66 (patch)
tree64b866176576a56b6ddb9c2e841e88796fd7dedb /src/qml/memory/qv4mm_p.h
parent8acf7385f341752984db280773f167e405b8bc12 (diff)
Let allocData/allocString return 0 initialized memory
There's no point in having the memset inline. In theory, the compiler could optimize by combining this with later on inline initialization code, in practice this doesn't happen anyway, and we have some options of avoiding or combing the memsets in the allocator. Change-Id: I4502ef947ae235223726269821f9482ad62e1070 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.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h
index 9cb71e70de..7517328b37 100644
--- a/src/qml/memory/qv4mm_p.h
+++ b/src/qml/memory/qv4mm_p.h
@@ -217,7 +217,6 @@ public:
V4_ASSERT_IS_TRIVIAL(typename ManagedType::Data)
size = align(size);
Heap::Base *o = allocData(size);
- memset(o, 0, size);
o->setVtable(ManagedType::staticVTable());
return static_cast<typename ManagedType::Data *>(o);
}
@@ -251,7 +250,6 @@ public:
typename ManagedType::Data *allocWithStringData(std::size_t unmanagedSize, Arg1 arg1)
{
typename ManagedType::Data *o = reinterpret_cast<typename ManagedType::Data *>(allocString(unmanagedSize));
- memset(o, 0, sizeof(sizeof(typename ManagedType::Data)));
o->setVtable(ManagedType::staticVTable());
o->init(this, arg1);
return o;