alignment: use proper alignment size

Pass proper alignment size when use allocate_align(). This will
fix alignment trap issues on ARM.

Signed-off-by: Beilu Shao <beilushao@gmail.com>
This commit is contained in:
Beilu Shao
2016-10-16 23:59:13 +02:00
parent 87ff7e4ccc
commit b4786711df
38 changed files with 163 additions and 150 deletions

View File

@@ -203,7 +203,7 @@ template <typename... Args>
msgpack::object::with_zone& o,
msgpack::type::tuple<Args...> const& v) const {
o.type = msgpack::type::ARRAY;
o.via.array.ptr = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*sizeof...(Args)));
o.via.array.ptr = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*sizeof...(Args), MSGPACK_ZONE_ALIGNOF(msgpack::object)));
o.via.array.size = sizeof...(Args);
MsgpackTupleToObjectWithZone<decltype(v), sizeof...(Args)>::convert(o, v);
}