Re: [Qemu-devel] [PATCH v11 10/24] qapi: Unbox base members

2015-10-27 Thread Eric Blake
On 10/27/2015 01:52 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than storing a base class as a pointer to a box, just >> store the fields of that base class in the same order, so that >> a child struct can be directly cast to its parent. This gives >> less malloc overhead, less

Re: [Qemu-devel] [PATCH v11 10/24] qapi: Unbox base members

2015-10-27 Thread Markus Armbruster
Eric Blake writes: > Rather than storing a base class as a pointer to a box, just > store the fields of that base class in the same order, so that > a child struct can be directly cast to its parent. This gives > less malloc overhead, less pointer dereferencing, and even less > generated code.

[Qemu-devel] [PATCH v11 10/24] qapi: Unbox base members

2015-10-26 Thread Eric Blake
Rather than storing a base class as a pointer to a box, just store the fields of that base class in the same order, so that a child struct can be directly cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Compare to the earlier commit 1