mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-13 22:50:19 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user