Merge branch 'alignment' of https://github.com/chshaob1/msgpack-c into chshaob1-alignment

This commit is contained in:
Takatoshi Kondo
2017-07-22 15:18:36 +09:00
39 changed files with 164 additions and 152 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);
}