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

@@ -69,7 +69,7 @@ struct object_with_zone<my_class> {
o.type = type::ARRAY;
o.via.array.size = 2;
o.via.array.ptr = static_cast<msgpack::object*>(
o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
o.via.array.ptr[0] = msgpack::object(v.get_name(), o.zone);
o.via.array.ptr[1] = msgpack::object(v.get_age(), o.zone);
}